I have a Maven call that downloads artifacts for the purpose of running integration tests:
mvn -Dmdep.useRepositoryLayout=true -Dmdep.copyPom=true -Dmdep.useBaseVersion=true dependency:copy-dependencies -DoutputDirectory=deps -DexcludeTransitive=true -e
The pom consists purely of dependencies, nothing else. There are other scripts that pick up the artifacts from the
deps
dir and runs tests on them.Now, my problem is this: Even though Maven only copies the artifacts I want into
deps
, it still downloads all transitive dependencies to the Maven cache, which is a waste of time and bandwidth (the artifacts are compiled on another continent).Is there some way I can stop maven from downloading all the transitive dependencies into the cache?
Maven 3.0.4
Solutions using other tools like gradle or ant+ivy are also welcome, as long as they can create the maven repo layout in
deps
.
Answer
Maven has limited facilities to control dependency scope and the documentation is not the best. Here are a few for reference:
Attribution
Source : Link , Question Author : clacke , Answer Author : Paul Sweatte