问题
I want to configure "exploded" goal of the 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>
I need to run "exploded" goal manually and do not want to attach execution to any lifycycle phase. But when i execute "mvn war:exploded", maven ignores my configuration. Tell me please, how to do this :)
回答1:
Read this page for reference:
Guide to Configuring Default Mojo Executions
In essence:
it will work if you configure the execution with the 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>
来源:https://stackoverflow.com/questions/3750597/maven-configure-specific-goal