Maven, configure specific goal

倖福魔咒の 提交于 2019-12-06 23:57:55

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!