親モジュールに、コンパイルに必要なさまざまな jar を含む lib ディレクトリがあるが、最終製品には含まれていない Maven プロジェクトがあります。子モジュールをビルドしようとすると失敗します。「次の成果物を解決できませんでした」と表示され、最終的に「C:\path\to\project\modules\module_name\lib\local_dependency.jar に成果物 local_dependency が見つかりませんでした」と表示されます。
子モジュールは、親が使用するライブラリに依存していませんが、それでもそれらを含める必要があります。これを防ぐために設定する必要があるオプションはありますか?
親 Pom スニペット:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<currentVersion>1.0.0</currentVersion>
</properties>
<groupId>com.project</groupId>
<artifactId>project_artifact</artifactId>
<packaging>pom</packaging>
<version>${currentVersion}</version>
<modules>
<module>modules/module_name</module>
</modules>
<dependencies>
<dependency>
<groupId>group.id</groupId>
<artifactId>local_dependency</artifactId>
<version>1.0</version>
<systemPath>${basedir}/lib/local_dependency.jar</systemPath>
<scope>system</scope>
<optional>true</optional>
</dependency>
</dependencies>
子ポン スニペット:
<parent>
<groupId>com.project</groupId>
<artifactId>project_artifact</artifactId>
<version>${currentVersion}</version>
<relativePath>../../</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>net.some.dependency</groupId>
<artifactId>artifact_name</artifactId>
<version>1.0.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.project</groupId> <!-- The child depends on the parent for the parent's API-->
<artifactId>project_artifact</artifactId>
<version>${currentVersion}</version>
<type>jar</type>
</depdencency>
</dependencies>
したがって、これから、子 pom は project_base/modules/module_name/lib/local_dependency.jar から group.id:local_dependency を含めようとしますが、存在せず、存在する必要もありません。