0

I'm using the exec-maven-plugin and the pom is compiling, but it seems to not execute this plugin when I compile my project:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.2.1</version>
  <executions>
     <execution>
        <configuration>
           <executable>python</executable>
           <workingDirectory>scripts/python/</workingDirectory>
           <arguments>
              <argument>webxmlgen.py</argument>

              <argument>argument1</argument>
              <argument>argument2</argument>
           </arguments>
        </configuration>
        <id>generation</id>
        <phase>generate</phase>
        <goals>
           <goal>exec</goal>
        </goals>
     </execution>
  </executions>
</plugin>

Did I forget something? I'm also not sure about the phase and the goal I have to use...

Edit :

I've deleted the workingDirectory tag and put it directly in the argument and now it works with the phase generate-ressources, thanks !

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.2.1</version>
  <executions>
     <execution>
        <configuration>
           <executable>python</executable>
           <arguments>
              <argument>scripts/python/webxmlgen.py</argument>

              <argument>argument1</argument>
              <argument>argument2</argument>
           </arguments>
        </configuration>
        <id>generation</id>
        <phase>generate-ressources</phase>
        <goals>
           <goal>exec</goal>
        </goals>
     </execution>
  </executions>
</plugin>
Jérome Pieret
  • 228
  • 2
  • 10

1 Answers1

1

phase tells Maven when to execute it and goal tells it which target to invoke on the plugin when the phase is reached.

Your problem is that there is no generate phase. Here is a list. Try generate-resources instead.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820