JBoss AS 7 is still being developed on but lately file based deployment is now in place and I thought it would be a good thing to tell you how you can use JBoss AS 7 from our tools even before there is an optimized and fully supported server adapter for it.
It's not optimal, but at least it lets you get started.
For this blog I used JBoss AS 7 Beta 2 and JBoss Developer Studio 4; you can use a newer version of AS 7 (beta 3 is coming out soon) or if you have JBoss Tools 3.2.0 installed all this works fine too from there.
Read more below.
Start/Stop of AS 7
For now the best way to start/stop AS 7 when working from Eclipse is to simply start and stop it from a command line.
Press Ctrl+C in your terminal/command prompt
You can start AS 7 via Eclipse External Tools support but Stopping won't work since it will only stop the shell script not the actual running AS 7 instance. Thus for now - use the command line.
Deployment to AS 7
If you have a standard Eclipse Web Tools Project style project then the simplest is to use the Deploy Only server, if you have a free-form project you can also use Deploy Only server but maybe Project Archives gives you a better workflow. I'll outline the "Web Tools" and Project Archives approach below:
Create a Deploy Only Server
The "Deploy Only" server is available in JBoss Tools & Developer Studio and provides a server adapter that has no special knowledge about the server it is deploying to beyond a directory location. Thus this is perfect for using with servers that does not yet have direct support from within Eclipse.
To create one you simply hit Ctrl+N or use File > New > Other from the menu and find the Server wizard.
Within the Server wizard you need to find and select the "Deploy Only" server:
Press "Next", and then give your server a name and specify the directory location for deployments.
For AS 7 standalone deployments goes to $JBOSS_HOME/standalone/deployments.
Press "Finish" and you should now have your "AS 7" server available in the servers view:
Now you have a "Server" which you can deploy standard Web tools projects to; you simply drag'n'drop deployable resources to the server or use the "Add and Remove" available in the context menu.
Enable Compressed Archives
There is one "gotcha" with this setup and that is that with AS 7 for exploded deployments it now requires a .dodeploy marker to explicitly trigger a (re)deployment of an exploded directory.
The simplest way to avoid having to set this up is to enable "Compressed Archives" from within the tools since AS 7 will automatically deploy such archives once they are complete.
To enable this, double click the Server and it's server editor should show up.
In this editor, switch to the Deployment tab and make sure there is a checkmark for "Deploy projects as compressed archives".
With this done you can now easily add any war/jar/ear project to the server and deploy it.
Above I've added a project called "helloworld".
To deploy or redeploy this simply right click the server and choose "Publish" (you can also use the keyboard shortcut shown in the menu for easier access).
Exploded and Explicit Deployments
If you really want to use exploded deployments then there is a trick you can do to simulate the .dodeploy marker with JBoss Tools.
Simply create a text file in your project called "foo.war.dodeploy" where foo.war should the name of your deployment. In my case that is "helloworld.war.dodeploy".
Then right click this file and choose "Mark as Deployable"
This should then automatically get deployed to your sever (if you have multiple there will be a dialog asking you which server to deploy to)
If you don't know what a "dodeploy marker" is look in the README.txt in $JBOSS_HOME/standalone/deployments for an explanation.
Please note that Deploy Only server currently does not support automatic publishing thus you have explicit invoke Publish when you are ready.
This will be fixed in upcoming release of JBoss Tools 3.2.
Deploy using Project Archives
Project Archives is mostly relevant for those not using Web Tools style projects, but is also usable for deploying to AS 7 - the feature is already documented and even with a screencast in a previous blog
Please, Make this easier!
We are working on it and the first steps of an AS 7 adapter is already in JBoss Tools trunk which will be JBoss Tools 3.3 and target Eclipse 3.7.
If you are interested in that work ask on the forums where we will keep you updated with the progress, i.e. when there will be an updatesite to install and use from