Java リソース ファイルに追加のテキストを書き込みたい (2 つの .java ファイルを 1 つに結合する)。そのための Python スクリプトを作成します。
また、Maven を使用して手順 (ファイルの結合、コンパイル、パッケージ化) を自動化したいと考えています。私はMavenの初心者ですがexec-maven-plugin
、Pythonスクリプトを実行できることがわかりました。
<phase>process-resources</phase>
コンパイル前に起動するように設定しようとしたのですが、Eclipse が文句を言いました。Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(execution: default, phase: process-resources)
以下は私のexec-maven-pluginのpomです:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>process-resources</phase> <!-- Eclipse complains an error here -->
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>python</executable>
<workingDirectory>src/main/python</workingDirectory>
<arguments>
<argument>combine.py</argument>
</arguments>
</configuration>
</plugin>
この目的をどのように実装できるか知っている人はいますか? どうもありがとう。