私はm2eclipseを 2 年ほど使用しており、現在はm2eに切り替えています。
残念ながら、これは私にとっていくつかの機能を壊してしまいました。
多くのプロジェクトで、私は Java コードを生成してきましたが、通常はライブラリ プロジェクトのメイン クラスを介して生成されます。典型的なセットアップは次のとおりです。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generateDTOs</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>com.somecompany.SomeCodeGenerator</mainClass>
<arguments>
<argument>${project.build.directory}/generated-sources/foo</argument>
<argument>${project.basedir}/path/to/a/config/file</argument>
<argument>more arguments</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>addDtoSourceFolder</id>
<goals>
<goal>add-source</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/foo</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
以前は、Eclipse を使用してそのプロジェクトを Maven プロジェクトとしてインポートするだけで、コードが自動的に実行され、ソース フォルダーが Eclipse プロジェクトに追加されていました。
これで、m2e は buildhelper プラグイン用の「コネクタ」をインストールしたので、ソース フォルダーが作成されましたが、Run As > Maven > generate-sources
. これは本当に面倒です。以前のように、maven ビルドが pom.xml の変更、Project > Clean ...
SVN の更新、Eclipse の起動などに応答するようにしたいと考えています。
m2e を m2eclipse のように動作させるにはどうすればよいですか?