1 Reply Latest reply on Nov 3, 2018 9:02 AM by Rakesh K. Cherukuri

    Slow performance with ShrinkWrap

    Vincent Massol Newbie

      Hi guys,

       

      I'm using Shrinkwrap on XWiki and it's great. However it's very slow ATM and I'm wondering why. Doesn't Shrinkwrap check if the artifact is in the local repo or in the CP before checking in the maven remote repos specified? Is it possible to have this behavior?

       

      Here's how I use Shrinkwrap:

       

      List<MavenResolvedArtifact> artifacts = resolveArtifactWithDependencies(

        String.format("org.xwiki.platform:xwiki-platform-distribution-war-dependencies:pom:%s", version));

       

      protected List<MavenResolvedArtifact> resolveArtifactWithDependencies(String gav)

      {

         return getConfigurableMavenResolverSystem()

             .resolve(gav)

             .withTransitivity()

             .asList(MavenResolvedArtifact.class);

      }

       

      protected ConfigurableMavenResolverSystem getConfigurableMavenResolverSystem()

      {

         return Maven.configureResolver()

             .withClassPathResolution(true)

             .withRemoteRepo(

                   "mavenXWikiSnapshot", "http://nexus.xwiki.org/nexus/content/groups/public-snapshots", "default")

             .withRemoteRepo(

                   "mavenXWiki", "http://nexus.xwiki.org/nexus/content/groups/public", "default");

      }

       

      And in the logs I get tons of stuff like:

       

      Jul 18, 2018 5:24:06 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/commons/xwiki-commons-pom/10.7-SNAPSHOT/maven-metadata.xml from https://repo1.maven.org/maven2/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.commons:xwiki-commons-pom:10.7-SNAPSHOT/maven-metadata.xml in central (https://repo1.maven.org/maven2)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/commons/xwiki-commons/10.7-SNAPSHOT/maven-metadata.xml from https://repo1.maven.org/maven2/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.commons:xwiki-commons:10.7-SNAPSHOT/maven-metadata.xml in central (https://repo1.maven.org/maven2)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      WARNING: Unknown repository update policy '', assuming 'never'

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      WARNING: Unknown repository update policy '', assuming 'never'

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/platform/xwiki-platform-distribution-war-dependencies/10.7-SNAPSHOT/maven-metadata.xml from https://repo1.maven.org/maven2/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.platform:xwiki-platform-distribution-war-dependencies:10.7-SNAPSHOT/maven-metadata.xml in central (https://repo1.maven.org/maven2)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/platform/xwiki-platform-distribution-war-dependencies/10.7-SNAPSHOT/maven-metadata.xml from http://nexus.xwiki.org/nexus/content/groups/public/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.platform:xwiki-platform-distribution-war-dependencies:10.7-SNAPSHOT/maven-metadata.xml in mavenXWiki (http://nexus.xwiki.org/nexus/content/groups/public)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      WARNING: Unknown repository update policy '', assuming 'never'

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      WARNING: Unknown repository update policy '', assuming 'never'

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      WARNING: Unknown repository update policy '', assuming 'never'

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/platform/xwiki-platform-distribution/10.7-SNAPSHOT/maven-metadata.xml from http://nexus.xwiki.org/nexus/content/groups/public/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.platform:xwiki-platform-distribution:10.7-SNAPSHOT/maven-metadata.xml in mavenXWiki (http://nexus.xwiki.org/nexus/content/groups/public)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener transferFailed

      WARNING: Failed downloading org/xwiki/platform/xwiki-platform-distribution/10.7-SNAPSHOT/maven-metadata.xml from https://repo1.maven.org/maven2/. Reason:

      org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata org.xwiki.platform:xwiki-platform-distribution:10.7-SNAPSHOT/maven-metadata.xml in central (https://repo1.maven.org/maven2)

      Jul 18, 2018 5:24:07 PM org.jboss.shrinkwrap.resolver.impl.maven.logging.AetherLoggerFactory$Logger warn

      [...]

       

      Thanks for any help

      -Vincent

        • 1. Re: Slow performance with ShrinkWrap
          Rakesh K. Cherukuri Newbie

          workOffline() Seems to achieve what you are trying to accomplish

           

          Ex:

           

          Maven

          .configureResolver()

          .workOffline()

          .resolve(mavenCoordinate)

          .withoutTransitivity()

          .asSingleFile();

           

          I am using :

           

                     <dependency>

                          <groupId>org.jboss.shrinkwrap.resolver</groupId>

                          <artifactId>shrinkwrap-resolver-api-maven</artifactId>

                          <version>3.1.3</version>

                          <scope>test</scope>

                      </dependency>