Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wagon ssh / scp: No connector available to access repository ... of type default using the available factories WagonRepositoryConnectorFactory

Is this a bug of wagon-ssh 2.10?

What might work?

E.g. what combination of Maven, Wagon-SSH and pom settings will get the behaviour back that was there with Maven 3.0.5 and wagon-ssh 2.4?

After upgrading to wagon-ssh 2.10 in my pom.xml to check whether this would fix my problems according to https://issues.apache.org/jira/browse/MDEPLOY-177 see also How to fix or workaround wagon bug?

I get the following error message:

No connector available to access repository XXX-snapshot-repository 
(scp://XXX/srv/repo/snapshots/) of type default 
using the available factories WagonRepositoryConnectorFactory

Looking into No connector available using eclipse aether package to deploy through maven plugin

I was assuming it might be a maven version problem. Indeed I had been sticking to an older 3.0.5 maven for a while since the wagon-ssh had been broken for scp transfers for many months

mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)

So i upgraded to Maven 3.3.3

mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)

which slightly modifies the error message:

Cannot access scp://XXX/srv/repo/snapshots/ with type default using the available connector factories: BasicRepositoryConnectorFactory

Looking into Failed to deploy maven project, no connector available

there seem to be different types of ConnectorFactories

  1. WagonRepositoryConnectorFactory (Maven 3.0.5)
  2. BasicRepositoryConnectorFactory (Maven 3.3.3)
  3. AetherRepositoryConnectorFactory (Maven ?)

Looking into https://stackoverflow.com/a/18253897/1497139 there is a pointer to http://maven.apache.org/guides/mini/guide-using-extensions.html which is supposed to explain how to add connectors (6 people upvoted this answer) - but i do not find a mention of ConnectorFactory there.

an internet search for

wagon-ssh ConnectorFactory scp

has some of the links already mentioned in this question and:

Is there any way of having maven scp wagon work consistently on linux/mac/windows platform?

where the configuration style is mentioned that I had been using successfully for some 2 years now.

I observed that the following download happened when i did a maven install on the parent pom.xml alone:

mvn install
[INFO] Scanning for projects...
Downloading: http://uk.maven.org/maven2/org/apache/maven/wagon/wagon-provider-api/2.10/wagon-provider-api-2.10.jar
Downloaded: http://uk.maven.org/maven2/org/apache/maven/wagon/wagon-provider-api/2.10/wagon-provider-api-2.10.jar (53 KB at 129.4 KB/sec)

But this doesn't change the situation for the child project.

Here is an excerpt of the pom:

   <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>2.10</version>
        </extension>
    </extensions>


   <distributionManagement>
        <snapshotRepository>
            <id>XXX-snapshot-repository</id>
            <name>XXX Maven2 Snapshot Repository</name>
            <url>scp://XXX/srv/repo/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
like image 452
Wolfgang Fahl Avatar asked Nov 15 '15 07:11

Wolfgang Fahl


3 Answers

I must admit I feel slightly stupid but since others might have similar issues I am showing what resolved the issue:

<parent>
    <groupId>XXX</groupId>
    <artifactId>XXX</artifactId>
    <version>XXX-SNAPSHOT</version>
    <relativePath>../XXX/pom.xml</relativePath>
</parent>

so the pom declarations shown above where merely not being picked up at all.

like image 161
Wolfgang Fahl Avatar answered Nov 18 '22 03:11

Wolfgang Fahl


You have a submenu layout and

<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-ssh</artifactId>
      <version>2.10</version>
  </extension>
</extensions>

Was not found while uploading! As you resolved the issue via referencing <relativePath> the parent, the wagon-ssh was finally found in the parent-pom.

By the way, if you run into this problem by mvn release and this is the only step that failed, you do not need to release again, just type mvn deploy to complete the release!

like image 29
Grim Avatar answered Nov 18 '22 03:11

Grim


I tried 'mvn install' in pom.xml location and all the things got configured automatically. Now I'm able to run my project as maven install.

like image 1
Alok Singh Avatar answered Nov 18 '22 03:11

Alok Singh