親 pom と 2 つのモジュール pom があります。最初のモジュールでは、2 番目のモジュール (jar) をいくつかのフォルダーにコピーします。最初のモジュール pom からプロジェクトをコンパイルすると動作しますが、親プロジェクトの pom からコンパイルしようとすると、プラグインは jar の insted モジュール クラスをコピーしようとします。
[エラー] プロジェクト module1 で目標 org.apache.maven.plugins:maven-dependency-plugin:2.1:copy (default) を実行できませんでした: /home/chardex/projects/test/module2/target/classes からアーティファクトをコピー中にエラーが発生しました/home/chardex/projects/test/module1/target/lib/classes: /home/chardex/projects/test/module2/target/classes (ディレクトリです) -> [ヘルプ 1]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>...</groupId>
<artifactId>module2</artifactId>
<version>...</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
ありがとう。