aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Wagon-ssh with Maven 2.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Wagon-ssh with Maven 2.2" Watch "Wagon-ssh with Maven 2.2" New topic
Author

Wagon-ssh with Maven 2.2

T H Lim
Greenhorn

Joined: Oct 14, 2004
Posts: 28
Hi,

I want to use wagon-ssh (1.0-beta-7) plugin to deploy my assembled (via assembly:assembly) application to another server using SSH. It failed with a fatal error,

[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin descriptor for the plugin Plugin [org.apache.maven.wagon:wagon-ssh] was not found. Please verify that the plugin JAR /Users/sshark/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.jar is intact.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin [org.apache.maven.wagon:wagon-ssh] was not found. Please verify that the plugin JAR /Users/sshark/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-7/wagon-ssh-1.0-beta-7.jar is intact.

My maven and OS versions are stated below. Can anyone help me as of why the wagon plug in is not intact? Does it require maven 3? Thanks

Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_24
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.8" arch: "x86_64" Family: "mac"


/lim/
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I use wagon-ssh all the time. I am currently using Maven 3.0.3 but I am fairly certain that I used it with 2.2.1 a while back. Things I would try:

a) Delete /Users/sshark/.m2/repository/org/apache/maven/wagon/wagon-ssh/ and all of its contents and let Maven download wagon-ssh again.

b) Try an earlier version of wagon-ssh.

Also, please post your pom.xml, at least the part the mentions wagon-ssh. Perhaps it is not correctly defined. (I suspect you defined it as a plugin rather than as an extension).


JBoss In Action
T H Lim
Greenhorn

Joined: Oct 14, 2004
Posts: 28
I am guilty of including it as a plugin. How do i I make it as extension? Here is part of my pom.xml. Thanks

T H Lim
Greenhorn

Joined: Oct 14, 2004
Posts: 28
I modified my pom.xml to include extension but it still didn't work

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

You now have the extension declared correctly, but you have to remove the plugin (delete lines 26-45)

You have read the docs, right?
http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html
T H Lim
Greenhorn

Joined: Oct 14, 2004
Posts: 28
I have read the document but it didn't cross my mind there is an "extension" in addition to plugins. I read the article and it was meant to deploy to the repository via SSH. how do I copy an assembled JAR file (not include pom.xml & sources) to another host via SSH? Meanwhile I will reread the docs.

Thanks

/lim/
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

TH Lim wrote:how do I copy an assembled JAR file (not include pom.xml & sources) to another host via SSH?

First, you have to configure the server to use ssh. You need to google to find out how: "configure ssh xxx" - replace xxx with the OS name of the remote machine that you are going to ssh into.

Then you need the scp command. Don't know if OSx comes with that or not, but even if it doesn't there should be one available on the net.

Then run:

scp /path/to/your/.jar remoteusername@remotehostname/path/on/host

Essentially, this is what the Wagon extension does.
T H Lim
Greenhorn

Joined: Oct 14, 2004
Posts: 28
Finally, I nailed the problem with this. Thank you for your advise.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

OK, so you used the Wagon plugin instead of the Deploy plugin. That's fine, glad you got it working! And thank you for posting your solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wagon-ssh with Maven 2.2