我正在使用最新的Eclipse和Maven,
我有一个带有maven-jar-plugin和maven-war-plugin的项目,如下所示
很明显clean install
会创建一个jar和战争,但是我可以运行只创建jar跳过战争创建(不更改pom)的命令吗?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include>**/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<classifier>wardeploy</classifier>
<warSourceDirectory>WebContent</warSourceDirectory>
<warName>MyName</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</execution>
</executions>
</plugin>
答案 0 :(得分:0)
我成功地使用
跳过了战争(仅创建jar)clean install -Dmaven.war.skip
在plugin source中找到它:
@Parameter(property =“ maven.war.skip”,defaultValue =“ false”)