gpt4 book ai didi

java - Maven,配置具体目标

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:39:27 24 4
gpt4 key购买 nike

我想配置 maven-war-plugin 的“分解”目标:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>exploded</goal>
</goals>
<configuration>
<webappDirectory>war</webappDirectory>
</configuration>
</execution>
</executions>
</plugin>

我需要手动运行“分解”目标并且不想将执行附加到任何 lifycycle 阶段。但是当我执行“mvn war:exploded”时,maven 忽略了我的配置。请告诉我,该怎么做:)

最佳答案

阅读此页面以供引用:

Guide to Configuring Default Mojo Executions

本质上:

如果您使用 id default-cli 配置执行,它将起作用

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>exploded</goal>
</goals>
<configuration>
<webappDirectory>war</webappDirectory>
</configuration>
</execution>
</executions>
</plugin>

关于java - Maven,配置具体目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3750597/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com