The following configuration works with JBoss. Adjust accordingly with your app server. Assuming you have all the required plugins as laid out in the earlier post.
Configuration Steps
- In the JBoss deploy folder, create any folder with folder name ending with .war (e.g. myProject.war)
- Setup your IDE environment with Maven plugin and run the project as usual.
- Make sure your project compiles and generates a .ear or .war file in the default Maven target folder structure. Extract the lib folder as it contains all the dependencies of your project.
- Inside the myProject.war, create a WEB-INF folder and paste that lib folder. This is the only manual step that requires due attention. Rest is just configuration and synchronization!
- Configure Java Rebel as laid out in the earlier post. However, put the Java Rebel settings in JBossDir/bin/run.bat file.
- Ensure the classpath of your Maven project in your IDE has all the Java paths and resources folders. Also ensure that the output directory for your project classpath is myProject->target->classes folder
- Using FileSync plugin, synchronize two folders (from within Eclipse)
- MavenProject->web->src->main->webapp to deployDir->myproject.war folder
- MavenProject->target->classes to deployDir->myproject.war->WEB-INF->classes
- That's it.
- Continue coding, run JBoss in background from the console using run.bat file in JBoss/bin directory. Save your file (.java, .js, .ftl, .vm, .xml) and check it immediately in your browser.
Smart Coding....