Deploying exploded war to Jboss with Netbeans and Maven
I'm starting a new Java EE 6 project using N开发者_如何学编程etbeans 7, Maven 3 and JBoss 6. In past projects, I have been using Glasshfish 3. Deployment worked quite well with glassfish, automatically exploding a war and deploying it, so dynamic files (xhtml) was updated instantly.
Is it possible to achieve this using JBoss 6? Default behaviour seem to be a normal package and deploy a WAR-file. I'm guessing that i need Maven to do it completely by itself, but I'm lacking quite alot of knowledge in that area. Can anyone help me out with configuring Maven to accomplish this automatically, or is it possible to do with netbeans settings only? My intended result is to be able to save .xhtml files directly in netbeans and see the result instantly.
Have you tried it with Netbeans 7 and JBoss 6? Should be same as with Glassfish. After full redeploy your html/xhtml files should be updated (try Ctrl + F5 in a browser to fully refresh the page)
Redeploy takes lot of time.
So I use soft link. Create a softlink under /server/default/deploy/ This link has to map to your target/web folder ( build/web). All changes to xhtml will automatically effected. You may need to restart the application when class files change.
To restart the application just touch (or add space and save) web.xml or jboss-web.xml jboos is listening so it will restart the application.
Did I mention this wont work if you are on windows. Here is the clue for creating soft link
ln -s myProject.war myproject/target/web
Edit : Tip
Nb7 may crash or go outofmemmory when jboss6 is used. I removed jboss6 from servers-tab. Changed my project to use glassfish. Run jboss from outside NB7. Now it works like a charm.
try jboss-maven-plugin with "true"
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.serverName}</serverName>
<fileNameEncoding>UTF-8</fileNameEncoding>
<unpack>true</unpack>
</configuration>
<executions>
<execution>
<id>hard-delpoy</id>
<phase>install</phase>
<goals>
<goal>hard-deploy</goal>
</goals>
</execution>
</executions>
</plugin>
精彩评论