0

私は exec-maven-plugin を使用しており、pom はコンパイルしていますが、プロジェクトをコンパイルするときにこのプラグインが実行されないようです:

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

私は何かを忘れましたか?また、使用しなければならないフェーズと目標についてもわかりません...

編集 :

workingDirectory タグを削除して直接引数に入れました。これで、generate-ressources フェーズで動作するようになりました。ありがとうございます。

<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>
4

1 に答える 1

1

phaseいつ実行するかをMavenにgoal伝え、フェーズに達したときにプラグインで呼び出すターゲットを伝えます。

あなたの問題は、generateフェーズがないことです。ここにリストがありますgenerate-resources代わりに試してください。

于 2013-11-06T15:20:31.980 に答える