cskwrd
cskwrd

Reputation: 2885

One click build and deploy using Eclipse/Maven/JBoss AS 7

I was wondering if it is possible to make a Java EE application being managed by Maven and automatically deploy it to JBoss all from Eclipse. To my knowledge I current right click on my project and select "Make install". After that completes, I open the server pane and right click on my deployed ear and either select "Full Publish" or "Incremental Publish". Is there a way to condense these actions into one click? I tried to write a windows batch file but I didn't have much luck with that, and it would only work for our devs working on Windows machines. I know I can make run configurations but when I try to make one it is very intimidating and I get frustrated and give up.

Thanks for your help!

Upvotes: 2

Views: 9501

Answers (2)

Fred Bricon
Fred Bricon

Reputation: 5569

You can use JBoss Tools 3.3.0 (Current milestone M4) with the maven integration to easily deploy projects (wars or ears) to your AS7 server.

Once you defined your AS7 instance in eclipse, all you have to do is right click on your project > Run As ...> Run on Server. It'll start your app server if it's stopped, or just deploy your app if it's already running.

See http://vimeo.com/25768303 and http://community.jboss.org/en/tools/blog/2011/11/09/jboss-tools-shift-happens-in-m4

Upvotes: 3

jasalguero
jasalguero

Reputation: 4181

If you are using maven, you can use the cargo plugin: http://cargo.codehaus.org/Maven2+plugin

You just configure where the JBoss is installed, set the plugin to run in the phase you want (or make a new one) and you are all set.

You can also create different configurations for different profiles, so you have local, integration, test, production, etc... And just by running with the selected profile deploys the ear in the server, remote or local.

If you want more control, you can set the path of the container as a variable that you pass in the Eclipse run configuration, that way each developer can have their servers in different paths.

Upvotes: 1

Related Questions