wagon-ssh(-external) requires explicit username
-----------------------------------------------

         Key: MNG-712
         URL: http://jira.codehaus.org/browse/MNG-712
     Project: Maven 2
        Type: Bug
  Components: maven-core  
    Versions: 2.0-beta-1, 2.0-alpha-3    
 Environment: Linux u-235 2.6.10-gentoo-r4 #1 SMP Mon Jan 10 14:53:56 EST 2005 
i686 AMD Athlon(tm) MP 2400+ AuthenticAMD GNU/Linux
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
 Reporter: Andrew Moore
    Priority: Minor


When attempting to utilise the scp or scpexe protocols, wagon-ssh and 
wagon-ssh-external only consider parameters set explicitly in either 
~/.m2/settings.xml or a pom.

The user.name system property and any username included in a URL are ignored.

For example, the following ~/.m2/settings.xml / pom combination works.

settings.xml:

  <servers>
      <server>
        <id>repos</id>
        <username>amm</username>
      </server>
    </servers>

pom.xml:

  <distributionManagement>
      <repository>
        <id>repos</id>
        <url>scpexe://server/path/to/deploy/repos</url>
      </repository>
    </distributionManagement>

Omitting the <username> tag from ~/.m2/settings.xml yields the following:

$ m2 clean:clean deploy
[INFO] Using local copy of plugins.xml (plugin mappings) for group: 
'org.apache.maven.plugins' from: 
/home/amm/.m2/repository/org/apache/maven/plugins/plugins.xml
[INFO] maven-clean-plugin: resolved to version 2.0-alpha-3 from local repository
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Distra
[INFO]    task-segment: [clean:clean, deploy]
[INFO] 
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] maven-install-plugin: resolved to version 2.0-alpha-3 from local 
repository
[INFO] maven-deploy-plugin: resolved to version 2.0-alpha-3 from local 
repository
[INFO] [install:install]
[INFO] Installing 
/secure/home/amm/prj/bt3/migration/distra/trunk/distra/pom.xml to 
/home/amm/.m2/repository/com/distra/distra/1.0/distra-1.0.pom
[INFO] [deploy:deploy]
---------------------------------------------------
constituent[0]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-artifact-2.0-beta-1-SNAPSHOT.jar
constituent[1]: file:/opt/maven-2.0-SNAPSHOT/lib/commons-cli-1.0-beta-2.jar
constituent[2]: 
file:/opt/maven-2.0-SNAPSHOT/lib/plexus-input-handler-1.0-alpha-2.jar
constituent[3]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-plugin-mapping-2.0-beta-1-SNAPSHOT.jar
constituent[4]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-plugin-registry-2.0-beta-1-SNAPSHOT.jar
constituent[5]: 
file:/opt/maven-2.0-SNAPSHOT/lib/wagon-ssh-external-1.0-alpha-4.jar
constituent[6]: file:/opt/maven-2.0-SNAPSHOT/lib/wagon-file-1.0-alpha-4.jar
constituent[7]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-settings-2.0-beta-1-SNAPSHOT.jar
constituent[8]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-monitor-2.0-beta-1-SNAPSHOT.jar
constituent[9]: file:/opt/maven-2.0-SNAPSHOT/lib/jline-0.9.1.jar
constituent[10]: file:/opt/maven-2.0-SNAPSHOT/lib/jsch-0.1.21.jar
constituent[11]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-plugin-descriptor-2.0-beta-1-SNAPSHOT.jar
constituent[12]: 
file:/opt/maven-2.0-SNAPSHOT/lib/wagon-http-lightweight-1.0-alpha-4.jar
constituent[13]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-plugin-api-2.0-beta-1-SNAPSHOT.jar
constituent[14]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-core-2.0-beta-1-SNAPSHOT.jar
constituent[15]: 
file:/opt/maven-2.0-SNAPSHOT/lib/doxia-sink-api-1.0-alpha-4-20050721.064859-1.jar
constituent[16]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-project-2.0-beta-1-SNAPSHOT.jar
constituent[17]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-profile-2.0-beta-1-SNAPSHOT.jar
constituent[18]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-artifact-manager-2.0-beta-1-SNAPSHOT.jar
constituent[19]: file:/opt/maven-2.0-SNAPSHOT/lib/wagon-ssh-1.0-alpha-4.jar
constituent[20]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-model-2.0-beta-1-SNAPSHOT.jar
constituent[21]: 
file:/opt/maven-2.0-SNAPSHOT/lib/maven-reporting-api-2.0-beta-1-SNAPSHOT.jar
constituent[22]: 
file:/opt/maven-2.0-SNAPSHOT/lib/wagon-provider-api-1.0-alpha-4.jar
---------------------------------------------------
java.lang.IllegalArgumentException: Authentication Credentials cannot be null 
for SSH protocol
        at 
org.apache.maven.wagon.providers.sshext.ScpExternalWagon.openConnection(ScpExternalWagon.java:90)
        at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:123)
        at 
org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:151)
        at 
org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:92)
        at 
org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:72)
        at 
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:168)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:361)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:472)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:445)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:431)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:127)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Changing the URL to scpexe://[EMAIL PROTECTED]/path/to/deploy/repos makes no 
difference.

The same behaviour is also observed with the scp:// protocol.

I would expected the scp username to be either extracted from the URL or 
implied by the user.name system property in the above example.

I would also expect privateKey to be determined in a similar manner if not 
explicitly speciified.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to