1 Reply Latest reply on Nov 22, 2017 5:12 AM by Christian Wansart

    Shrinkwrap cannot find dependency in local repo

    Christian Wansart Newbie

      Hello,

       

      I have a Jenkins job setup which uses a custom settings.xml to load the dependencies. According to the ShrinkWrapResolver documentation, the "-s" command line is ignored. It searches in the local repository and then in the maven central.

      This is one of my failing test deployments:

       

        @Deployment
        public static Archive<?> createDeployment() {
          PomEquippedResolveStage pomFile = Maven.resolver().loadPomFromFile("pom.xml");
      
      
          WebArchive archive = ShrinkWrap.create(WebArchive.class)
              .addAsLibraries(pomFile.resolve("io.swagger:swagger-jaxrs").withTransitivity().asFile())
              .addAsLibraries(pomFile.resolve("org.mockito:mockito-all").withTransitivity().asFile())
              .addAsLibraries(pomFile.resolve("com.fasterxml.jackson.datatype:jackson-datatype-jsr310").withTransitivity().asFile())
              .addClasses(Article.class, JaxRsActivator.class)
              //... more adds
              .addAsResource("log4j2.xml")
              .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
          return archive;
        }
      

       

       

      I added a pre-build step to download the artifacts. I checked if they were downloaded in the local repository and I found them. So... I don't get why jackson-datatype-jsr310:pom fails to be loaded by Shrinkwrap.

       

      Nov 17, 2017 1:02:25 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNUNG: Failed downloading com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.7.4/jackson-datatype-jsr310-2.7.4.pom from https://repo.maven.apache.org/maven2/. Reason:

      org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.fasterxml.jackson.datatype:jackson-datatype-jsr310:pom:2.7.4 from/to central (https://repo.maven.apache.org/maven2): Error transferring file: repo.maven.apache.org

      Nov 17, 2017 1:02:25 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNUNG: Failed downloading com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.7.4/jackson-datatype-jsr310-2.7.4.pom from http://repo1.maven.org/maven2/. Reason:

      org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.fasterxml.jackson.datatype:jackson-datatype-jsr310:pom:2.7.4 from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org

       

      Why can't Shrinkwrap find them?