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

北慕城南 提交于 2019-12-07 06:05:42

问题


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>

回答1:


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!




回答2:


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.




回答3:


use <url>scpexe://XXX/srv/repo/snapshots/</url> unless <url>scp://XXX/srv/repo/snapshots/</url>

look up deploy-ssh-external



来源:https://stackoverflow.com/questions/33717555/wagon-ssh-scp-no-connector-available-to-access-repository-of-type-default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!