maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Eckenfels <e...@zusammenkunft.net>
Subject Re: Using dependency plugin to build minimal local repository to run unit tests
Date Thu, 10 Sep 2015 23:22:55 GMT
Just run the Job you want to run with a fresh/empty local repository. 

> Am 11.09.2015 um 01:16 schrieb Andrew Wang <andrew.wang@cloudera.com>:
> 
> Hi Maven experts,
> 
> I'm trying to get a minimal set of local repository contents to be able to
> run unit tests for a project in offline mode. The dependency plugin
> documentation indicates that by default it's test scope, which is just what
> I want, so I did something like this (Maven 3.0.4):
> 
> # Copy what I can from my existing local repository to my temp repo
> mvn dependency:copy-dependencies -Dmdep.useRepositoryLayout=true
> -DoutputDirectory=/tmp/hadoop-deps -Dmdep.copyPom
> # Download things missed by copy:dependencies
> mvn dependency:go-offline -Dmaven.repo.local=/tmp/hadoop-deps
> # Try running offline unit test
> mvn -o surefire:test -Dtest=TestFoo -Dmaven.repo.local=/tmp/hadoop-deps
> 
> This was still missing some dependencies, so I ran this which downloaded
> some more:
> 
> mvn surefire:test -DskipTests -Dmaven.repo.local=/tmp/hadoop-deps
> 
> Invoking offline maven to run TestFoo still failed though, this time
> missing Surefire. After doing dependency:get on that, my offline test
> finally worked.
> 
> Is this expected behavior? I expected dependency:go-offline to be
> sufficient for this purpose. I'm was also very surprised that running `mvn
> surefire:test -DskipTests` did not download all the required dependencies.
> 
> If you have ideas on how better to do this, I'm also all ears :) This is
> related to some distributed testing experiments I'm doing for Apache Hadoop
> and HBase, which will hopefully be put into broader use upstream at some
> point.
> 
> Thanks,
> Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message