9

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 :)

abatishchev
  • 98,240
  • 88
  • 296
  • 433

1 Answers1

16

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>
Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
  • Thank you! You have solved my problem! I read the text by link above, but probably with not enough attention :) –  Sep 20 '10 at 11:54
  • 1
    I don't get it. Can you explain a little more? What would the command look like to invoke this? – MarkHu Jul 31 '17 at 22:34