3 Replies Latest reply on Nov 1, 2013 9:56 AM by Karel Piwko

    Maven resolver in a multi-module project

    Anton Kuranov Newbie



      I have a multi-module Maven project. And I want to include project's modules in my test. When I use maven resolver:


      WebArchive jar = ShrinkWrap.create( WebArchive.class, "mytest.war")

      .addAsLibraries( Maven.resolver().loadPomFromFile( "pom.xml" )

      .resolve( "myproject:mymodule" )

      .withTransitivity().asFile() );


      it tries to download the module from maven central:


      WARNING: Failed downloading myproject/mymodule/0.0.1-SNAPSHOT/maven-metadata.xml from http://repo1.maven.org/maven2/. Reason:

      org.sonatype.aether.transfer.MetadataTransferException: Could not transfer metadata myproject:mymodule:0.0.1-SNAPSHOT/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect from http://repo1.maven.org/maven2/myproject/mymodule/0.0.1-SNAPSHOT/maven-metadata.xml


      The question is how to make it to get a jar from the project's target directory or local repository?