You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Redden <jr...@matrix-consultants.com> on 2007/01/25 02:29:57 UTC

failures with wagon (new maven 2 user) somewhat long post ...

Fellow Maven Citizens,

- challange definiion:  'trying to use Wagon plugin to deploy to secure
server'.  Running scp as an action from - mvn deploy - fails with a
login prompt.  None of our secure servers have logins with passwords,
when running the Wagon plugin as a result of the deploy XML element in
the the pom, I receive a login prompt.  This results in a failure of the
deploy phase of the cycle.

- end goal for cyclic development:  Being able to deploy to our web
servers as a repeatable and stable process.  I like the enhanced build
capabilites of Maven, but one the main goals of the Maven project in my
company is to rationalize the deploy process.

- History of this challange:

	- configured pom.xml with  

	<repository>
    		<id>local repo</id>
    		<name>local</name>

<url>scp://morsel.matrix.cc:/usr/local/resin-3.1.0/webapps/ROOT/cosmos</url>
	<layout>default</layout>
	</repository>

	- configured settings.xml

	<server>
		<id>local repo</id>
		<username>integrat</username>
		<privateKey>/home/system76/.ssh/id_dsa</privateKey>
		<filePermissions>664</filePermissions>
		<directoryPermissions>775</directoryPermissions>
		<configuration></configuration>
	</server>

	-ran mvn -X deploy with this result:

(stuff deleted)

[DEBUG]     org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected
for runtime)
[DEBUG] Retrieving parent-POM: org.apache.maven:maven::2.0 for project:
org.apache.maven:maven-plugin-registry:jar:2.0 from the repository.
[DEBUG]     org.apache.maven:maven-plugin-registry:jar:2.0:runtime
(selected for runtime)
[DEBUG]   org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected
for runtime)
[DEBUG]   org.apache.maven:maven-artifact:jar:2.0:runtime (selected for
runtime)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-deploy-plugin:2.3:deploy' -->
[DEBUG]   (f) artifact = com.zenred:cosmos-web:war:0.0.1
[DEBUG]   (f) attachedArtifacts = []
[DEBUG]   (f) deploymentRepository = [local repo] ->
scp://morsel.matrix.cc:/usr/local/resin-3.1.0/webapps/ROOT/cosmos
[DEBUG]   (s) localRepository = [local] ->
file:///home/system76/.m2/repository
[DEBUG]   (f) packaging = war
[DEBUG]   (f) pomFile
= /home/system76/workspace2/cosmos/trunk/web/pom.xml
[DEBUG]   (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[INFO] [deploy:deploy]
altDeploymentRepository = null
[DEBUG] adding permissions to wagon connection: 664 775
The authenticity of host 'morsel.matrix.cc' can't be established.
RSA key fingerprint is 8f:f3:6c:fd:62:5a:22:48:b8:35:c6:34:1a:9b:c5:4d.
Are you sure you want to continue connecting? (yes/no): Password for
integrat@morsel.matrix.cc: [INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error deploying artifact: Authentication failed: Cannot connect.
Reason: Auth fail

[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error deploying
artifact: Authentication failed: Cannot connect. Reason: Auth fail
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
	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:585)
	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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
deploying artifact: Authentication failed: Cannot connect. Reason: Auth
fail
	at
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:174)
	at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
	... 16 more
Caused by:
org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error
deploying artifact: Authentication failed: Cannot connect. Reason: Auth
fail
	at
org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:91)
	at
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162)
	... 18 more
Caused by: org.apache.maven.wagon.TransferFailedException:
Authentication failed: Cannot connect. Reason: Auth fail
	at
org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:211)
	at
org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:109)
	at
org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:77)
	... 19 more
Caused by:
org.apache.maven.wagon.authentication.AuthenticationException: Cannot
connect. Reason: Auth fail
	at
org.apache.maven.wagon.providers.ssh.AbstractSshWagon.openConnection(AbstractSshWagon.java:239)
	at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:143)
	at
org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:178)
	... 21 more
Caused by: com.jcraft.jsch.JSchException: Auth fail
	at com.jcraft.jsch.Session.connect(Unknown Source)
	at com.jcraft.jsch.Session.connect(Unknown Source)
	at
org.apache.maven.wagon.providers.ssh.AbstractSshWagon.openConnection(AbstractSshWagon.java:228)
	... 23 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 37 seconds
[INFO] Finished at: Mon Jan 22 16:58:41 PST 2007
[INFO] Final Memory: 5M/11M
[INFO]
------------------------------------------------------------------------


	It should not be asking for a password here, but a pass phrase
associated to the public / private key pair.

	- connecting using scp from the command line works! 

system76@ubuntu:~/workspace2/suz_marine_util/trunk/sql$ scp
-i  /home/system76/.ssh/dsa /home/system76/tmp/vt_log_0.txt
integrat@morsel.matrix.cc:/tmp/
Enter passphrase for key '/home/system76/.ssh/id_dsa':
vt_log_0.txt                                 100%  278KB 277.7KB/s
00:00
system76@ubuntu:~/workspace2/suz_marine_util/trunk/sql$

	- I then had a sys admin to monitor ssh on the target server, morsel,
while running mvn and the error on that end is that my private key is
never being sent by maven.  Alternate configurations of settings.xml
avail none, such as including the pass phrase (Very lame programming to
do that B.T.W!). 

	- I then tried to find the source for the wagon plugin, which was a bit
confusing in that the latest is somewhat different from what seems to be
in the version of maven 2 I'm using, versions 1.0-alpha-5, 1.0-alpha-6,
1.0-alpha-7 and wagon-ssh-1.0-beta-2.jar all generate the incorrect ssh
response.

	- I then located the source to jsch-0.1.31 and built it using maven and
Eclipse 3.2.1.  Here's the kicker.  I some of the individual tests.
UserAuthPubKey in the jsch source directory *works fine*.  Shell fails
exactly like wagon in all its incarnations.


	- so short of rebuilding wagon and learning how to build a maven Mojo
( I only have some experience using maven so this is a learning
experience ),  I throw it out to the email user group as to how to
proceed next.


Regards,

John Redden




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Best documentation on how to deploy plugin into your local repo

Posted by John Redden <jr...@matrix-consultants.com>.
Sorry, my fuzziness.

Strictly a corporate repo.

-John R.


On Sun, 2007-03-25 at 20:56 -0600, Wayne Fay wrote:
> Depends on what kind of repo you're deploying to...
> 
> If you just want to have Maven2 download and install a plugin (into
> your local machine repo) so you can use it, just add it to your
> pom.xml and Maven will automatically take care of things. If you're
> behind a proxy, you need to configure the proxy first.
> 
> If you're not on the Internet, then you'll want to use the install
> plugin to install the plugin into your local repository -- mvn
> install:install-file ...
> 
> If you want to deploy a plugin to a "corporate repo", then you'll
> probably want to use the deploy plugin -- mvn deploy:deploy-file ...
> 
> Wayne
> 
> On 3/25/07, John Redden <jr...@matrix-consultants.com> wrote:
> > Hi Folks,
> >
> > Can a list subscriber recommend documentation to read that explains how
> > to deploy a plugin (not necessarily one you wrote) to a local repo?
> >
> > Many thanks,
> >
> > -John Redden
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Best documentation on how to deploy plugin into your local repo

Posted by Wayne Fay <wa...@gmail.com>.
Depends on what kind of repo you're deploying to...

If you just want to have Maven2 download and install a plugin (into
your local machine repo) so you can use it, just add it to your
pom.xml and Maven will automatically take care of things. If you're
behind a proxy, you need to configure the proxy first.

If you're not on the Internet, then you'll want to use the install
plugin to install the plugin into your local repository -- mvn
install:install-file ...

If you want to deploy a plugin to a "corporate repo", then you'll
probably want to use the deploy plugin -- mvn deploy:deploy-file ...

Wayne

On 3/25/07, John Redden <jr...@matrix-consultants.com> wrote:
> Hi Folks,
>
> Can a list subscriber recommend documentation to read that explains how
> to deploy a plugin (not necessarily one you wrote) to a local repo?
>
> Many thanks,
>
> -John Redden
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Best documentation on how to deploy plugin into your local repo

Posted by John Redden <jr...@matrix-consultants.com>.
Hi Folks,

Can a list subscriber recommend documentation to read that explains how
to deploy a plugin (not necessarily one you wrote) to a local repo?

Many thanks,

-John Redden



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Addenda to failures with wagon (one solution)

Posted by John Redden <jr...@matrix-consultants.com>.
More on this.

If you try maven deploy:deploy-file with just this setup, it will fail
(unless the user your running happens to be the same as the remote
repo).  The reason is that the comand line,  deploy:deploy-file does not
have an option to set the user.  The work around for this entails an
additional step, create the user the ssh expects when accessing you
local repo via scpexe.   For Linux I had to create a maven user.  I'm
not sure waht the procedure is for windows.

On Tue, 2007-03-13 at 08:27 -0700, John Redden wrote:
> I have found a workaround for the shortcomings of wagon.  
> 
> To deploy in an ssh environment on Linux:
> 
> 1.) run: ssh-agent /bin/bash
> 2.) run: ssh-add
> 3.) test your connections to the remote secure host:  ssh
> maven@my.remote.secure.host  and then logout
> 4.) run: mvn deploy
> 
> To deploy in an ssh environment on MS Windows:
> 
> 1.) run: pageant.exe 
> 2.) Everything is the same as it is for
> Linux, only the names of the executables are different. Instead of
> "ssh", you use "plink.exe". Instead of scp, you use "pscp.exe". Remember
> to provide the full path to the executables. It's the full DOS path, but
> with FORWARD slashes.  All the programs, pscp and pageant.exe, etc, are
> available here:
> http://www.deepfriedbutteronastick.com/ssh/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: failures with wagon (one solution)

Posted by John Redden <jr...@matrix-consultants.com>.
I have found a workaround for the shortcomings of wagon.  

To deploy in an ssh environment on Linux:

1.) run: ssh-agent /bin/bash
2.) run: ssh-add
3.) test your connections to the remote secure host:  ssh
maven@my.remote.secure.host  and then logout
4.) run: mvn deploy

To deploy in an ssh environment on MS Windows:

1.) run: pageant.exe 
2.) Everything is the same as it is for
Linux, only the names of the executables are different. Instead of
"ssh", you use "plink.exe". Instead of scp, you use "pscp.exe". Remember
to provide the full path to the executables. It's the full DOS path, but
with FORWARD slashes.  All the programs, pscp and pageant.exe, etc, are
available here:
http://www.deepfriedbutteronastick.com/ssh/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org