Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

No connector available to access repository ... of type default using the available factories WagonRepositoryConnectorFactory #25

Open
xeraa opened this issue Jul 24, 2014 · 13 comments

Comments

@xeraa
Copy link

xeraa commented Jul 24, 2014

I've set up the AWS Maven wagon in a project and it's working as expected — the Maven artifact is uploaded to our S3 account with the correct permissions.

However, when I try to reuse the artifact in another project, the download fails, because it cannot find a wagon to fetch from S3. The output of $ mvn deploy -X:

Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T15:51:42+02:00)
Maven home: /usr/local/Cellar/maven/3.2.2/libexec
Java version: 1.8.0_11, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.2.2/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/philipp/.m2/settings.xml
[DEBUG] Using local repository at /Users/philipp/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/philipp/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Skipped remote update check for com.xxx:parent-pom:1.4.11-SNAPSHOT/maven-metadata.xml, locally installed metadata up-to-date.
[DEBUG] Skipped remote update check for com.xxx:parent-pom:1.4.11-SNAPSHOT/maven-metadata.xml, locally installed metadata up-to-date.
[DEBUG] Skipped remote update check for com.xxx:parent-pom:1.4.11-SNAPSHOT/maven-metadata.xml, locally installed metadata up-to-date.
[DEBUG] java.util.NoSuchElementException
      role: org.apache.maven.wagon.Wagon
  roleHint: s3
org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
      role: org.apache.maven.wagon.Wagon
  roleHint: s3
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:264)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
    at org.eclipse.aether.internal.connector.wagon.PlexusWagonProvider.lookup(PlexusWagonProvider.java:33)
    at org.eclipse.aether.connector.wagon.WagonRepositoryConnector.lookupWagon(WagonRepositoryConnector.java:337)
    at org.eclipse.aether.connector.wagon.WagonRepositoryConnector.<init>(WagonRepositoryConnector.java:157)
    at org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory.newInstance(WagonRepositoryConnectorFactory.java:159)
    at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:139)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:531)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:171)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:224)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:903)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:755)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:452)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:421)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:385)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.util.NoSuchElementException
    at org.eclipse.sisu.plexus.RealmFilter$FilteredItr.next(RealmFilter.java:118)
    at org.eclipse.sisu.plexus.RealmFilter$FilteredItr.next(RealmFilter.java:1)
    at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:76)
    at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:1)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
    ... 34 more
[DEBUG] Writing tracking file /Users/philipp/.m2/repository/com/xxx/parent-pom/1.4.11-SNAPSHOT/parent-pom-1.4.11-20140722.193312-1.pom.lastUpdated
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM com.xxx:parent-pom:1.4.11-SNAPSHOT: Could not transfer artifact com.xxx:parent-pom:pom:1.4.11-20140722.193312-1 from/to maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot): No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 9, column 10

    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:405)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]   
[ERROR]   The project com.xxx:base:1.3.2-SNAPSHOT (/Users/philipp/Documents/IntelliJ/base/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM com.xxx:parent-pom:1.4.11-SNAPSHOT: Could not transfer artifact com.xxx:parent-pom:pom:1.4.11-20140722.193312-1 from/to maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot): No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 9, column 10 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact com.xxx:parent-pom:pom:1.4.11-20140722.193312-1 from/to maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot): No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:175)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:224)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:903)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:755)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:452)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:421)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:385)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.xxx:parent-pom:pom:1.4.11-20140722.193312-1 from/to maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot): No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:171)
    ... 22 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.xxx:parent-pom:pom:1.4.11-20140722.193312-1 from/to maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot): No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:546)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
    ... 26 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: No connector available to access repository maven.xxx.com-snapshot (s3://maven.xxx.com/snapshot) of type default using the available factories WagonRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:193)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:531)
    ... 27 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

I have added the wagon in both projects:

    <build>
        <!-- Necessary to deploy and fetch Maven artifacts to / from S3 -->
        <extensions>
            <extension>
                <groupId>org.springframework.build</groupId>
                <artifactId>aws-maven</artifactId>
                <version>5.0.0.RELEASE</version>
            </extension>
        </extensions>
    </build>

Do I need to register it somehow for downloads or what could I be doing wrong? I'm sure it's just something stupid on my part, but I'm unable to find it even though I've gone through the documentation multiple times...

@ehrlichja
Copy link

Were you ever able to resolve or get more information on this issue?

@xeraa
Copy link
Author

xeraa commented Dec 6, 2014

Unfortunately no. Would still love to use it though...

@ehrlichja
Copy link

We ended up creating an uber jar of the maven wagon and putting it in the maven lib directory. Then maven was able to load the wagon before trying to connect to S3 and the connection was successful.

@xeraa
Copy link
Author

xeraa commented Jan 14, 2015

The general issue seems to be, that you cannot fetch the parent of a project via S3, because Maven tries to load the parent before it loads the S3 plugin.

Adding the dependency to Maven's lib folder is clever, but not a solution for us since we're using a hosted Jenkins where we cannot put JARs into the Maven lib folder.

I'm out of ideas for this problem. Not sure if there's a good solution...

@beeva-pablovaliente
Copy link

Hello,

We have exactly the same problem xeraa has.

Has anyone found a solution without using the uber jar?

@xeraa
Copy link
Author

xeraa commented Apr 1, 2015

i don't think there is a good solution. and i've written a blog post about the whole thing, which might be interesting: https://medium.com/@xeraa/why-s3-is-not-the-perfect-maven-repository-8b06cb103a57
tl;dr s3 is perfect in theory but just doesn't work well in practice

@michaellieberherr
Copy link

Since Maven version 3.3.1 it's possible to add core extensions trough an additional extensions.xml (see https://issues.apache.org/jira/browse/MNG-5771) no patching needed, just add an extensions.xml at ${maven.projectBasedir}/.mvn/extensions.xml to your project:

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
    <!-- Repository on AMAZON S3 -->
    <extension>
        <groupId>org.springframework.build</groupId>
        <artifactId>aws-maven</artifactId>
        <version>5.0.0.RELEASE</version>
    </extension>
</extensions>

@greenreign
Copy link

This doesn't help this use case at the project level. It needs to be at a global level similar to what was mentioned (but apparently not addressed) by yuri in your referenced issue: https://issues.apache.org/jira/browse/MNG-5771

@jfneis
Copy link

jfneis commented Jul 4, 2017

Hi everyone, 2 years later, did someone came up with a solution for this? We are just looking for Maven+S3 to avoid Nexus/Artifactory but I'm afraid this problem won't allow us to.

@esaounkine
Copy link

@jfneis what's the OS where you face this issue? And what's the gradle version and how did you install it?

@jfneis
Copy link

jfneis commented Aug 10, 2017

@esaounkine I'm using Ubuntu 16 and Maven, no Gradle at all.

@feliperazeek
Copy link

@jfneis I was able to get it to work by defining the plugin on ${project.root}/.mvn/extensions.xml, click here for more information.

@jfneis
Copy link

jfneis commented Feb 14, 2018

@feliperazeek I was able to do it in project level too. The "fix" I asked for was about a global maven level.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

8 participants