java - Download dependencies to local repository but not to "target" one -


i have project, has pom.xml , depends on lots of dependencies outside (located far-far in internet..).

so, want download dependencies depend on "local repository".

this try (i not need compilation, use "validate" here. i'm not expect have "target" folder in end):

mvn validate -dmaven.repo.local=c:\my\.m2\repository dependency:copy-dependencies  

in end - yes have many dependencies been downloaded "c:\my\.m2\repository", of them went to: c:\projects\myproject\java\trunk\target\dependency, these ones:

junit-4.8.1.jar log4j-1.2.8.jar mockito-all-1.8.2.jar 

question is: how make downloaded "c:\my\.m2\repository" not "target" of project?

for now, because of that, projects depend on failing while building, because expecting find "junit-4.8.1.jar" in local repo.

another try:

mvn validate -dmaven.repo.local=c:\my\.m2\repository dependency:resolve 

then dependencies not resolvable @ all.

could not resolve dependencies project bla-bla-snapshot: following artifacts not resolved: commons-lang:commons-lang:jar:2.4, log4j:log4j:jar:1.2.8, junit:junit:jar:4.8.1: not find artifact commons-lang:commons-lang:jar:2.4 -> [help 1]

maven did because invoked goal dependency:copy-dependencies. copy dependencies of current module to

 ${project.build.directory}/dependency 

see http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html

i can't imagine these dependencies did not local repo. fiddling around script may not solution problem. try

 mvn process-resources -u -dmaven.repo.local=c:\my\.m2\repository 

the -u option forces download of dependencies. suggest using process-resources, although of understanding validate should fine, too.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -