5
私はmaven execプラグインでいくつかのタスクを実行しようとしています。 1つは、アプリケーションが使用するいくつかの外部データを生成するスクリプトを実行することです。 2番目は、コンパイル段階でいくつかの便利な作業を行うためにJavaコードのチャンクを実行することです。maven execプラグインのexecとjavaの両方の目標を定義できますか?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>data_for_app</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/getappdata.sh</executable>
<arguments>
<argument>${basedir}/src/main/webapp/WEB-INF/xml/appdatahere/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>do_convenience</id>
<phase>compile</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.example.DoConvenienceStuff</mainClass>
<arguments>
<argument>https://example.com/data</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
しかし、私は実行します。
mvn clean package exec:exec
私はエラーを取得する:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project jss: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -> [Help 1]
または同様のエラーは、パラメータ 'mainClass' は存在しないか、または無効ですと言って。
ありがとう:exec' - これも、文書だけでなく、SOにいくつかの他の回答を読んだ後、私には明らかではなかったです! –