aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Plugins jboss-maven-plugin and cargo-maven2-plugin with JBoss 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Plugins jboss-maven-plugin and cargo-maven2-plugin with JBoss 5" Watch "Plugins jboss-maven-plugin and cargo-maven2-plugin with JBoss 5" New topic
Author

Plugins jboss-maven-plugin and cargo-maven2-plugin with JBoss 5

Jean-Claude Rouvinez
Ranch Hand

Joined: Aug 26, 2003
Posts: 35
Hi,

I'm trying to deploy EAR artifacts to a remote JBoss server using cargo or the JBoss Maven Plugin but unfortunately none of this plugin works.

Who has managed it? How?
Any help is greatly appreciated.

Best Regards
Jean-Claude

Further Details:

Configuration
Maven version: 2.0.9
Java version: 1.6.0_07
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

jBoss 5.0.0.CR2
build: SVNTag=JBoss_5_0_0_CR2
date=200809171140

cargo-maven2-plugin
It is officially not possible to deploy an EAR file to a remote JBoss server using cargo according to Nabble - cargo eploy

jboss-maven-plugin
No success with the jboss-maven-plugin. Further information under Nabble - jboss eploy


Jean-Claude
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Jean-Claude,

How have you configured the maven plugin in particular? I not4ieced from the Nabble post that the final 'slash' is a forward one as opposed to a backwards one:

c:\jp\projects\ipi-ear-example\ipi-ear-example-ear\target/ear-example.ear


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Jean-Claude Rouvinez
Ranch Hand

Joined: Aug 26, 2003
Posts: 35
Hi Martijn,

The configuration is very simple. I didn't configure anything but the final name of the artifact:


Configuration of the plugins:

1). jboss-maven-plugin


2). cargo-maven2-plugin
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hmm, I was hoping to spot something there but as you say it's pretty simple. I'm afraid I can't help any further at this stage (we still manually deploy by unzipping several files including the EAR to the correct directories).
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Deploying to a remote JBoss AS has always been problematic because JBoss AS provides no help in this area (though with the new admin console, Embedded Jopr, there might be a way once tools, such as cargo, catch up).

The only way to do a remote deployment is to copy the file(s) to the remote host using network file copy, or ftp, or some other similar mechanism (or writing a web app that does deployment - I've done this before but like I said Embedded Jopr can do this now).

And a hint on doing a remote deploy: copy the file(s) to a temporary location first, and after the copy is complete, move the file(s) to the deploy directory. (You want to avoid having the hot deployer attempt to deploy your app when it is only partially copied, that can sometimes give bizarre error messages.)

Personally, I don't deploy often enough to worry about automation so I do it by hand. If I were to automate it, I would do it via an Ant script that did a network copy followed by a move. But then my PC and the server are both behind the firewall and I have the luxury of connecting to the server's disk.


JBoss In Action
Jean-Claude Rouvinez
Ranch Hand

Joined: Aug 26, 2003
Posts: 35
Hi Peter,

Thank you for your answer. It makes me feel more confident using this solution:

1).
I define an ant target (deploy_ear_file) in build.xml to deploy the artifact. This target uses scp to copy the artifact remotely and sshexec to move it to the deploy directory.

2).
I call this ant target from Maven

3).
I deploy the artifact to the remote host with the command:
mvn clean deploy


Appendix:
The section of the file pom.xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Plugins jboss-maven-plugin and cargo-maven2-plugin with JBoss 5