デフォルトのMyUser/.m2/repository/ではなく、プロジェクト固有のlibフォルダーに依存 jar を保存するように Maven を希望します。彼がプロジェクトを取得したとき、誰もがインターネットにアクセスできるわけではなく、グローバル ローカル リポジトリをコピーすることは、理想的とは言えない解決策のように思えます。
これらの依存関係をローカルの相対的なプロジェクト固有のフォルダーに保存して使用するようにmavenを説得するにはどうすればよいですか?
私の質問は、この Stackoverflow questionの言い換えバージョンのようです
私はこのようなことをしました:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${mvn-dependency-plugin.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/${local-lib-dir}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<build>
唯一の欠点は、eclipses maven がまだローカル リポジトリの jar を参照していることです。