Background
Here's the set up:
- Multi-developer environment using Subversion
- NetBeans 8.0.2
- JDK 1.7
- Java EE6
- JBoss 6.2 EAP running standalone
We may not change the tools; we may use neither Maven nor JRebel. Hardware upgrades are also not in scope.
Code Organisation
The source code, including web-related files, are checked out into:
C:\Apps\07-Work\Project\Project-Admin\Project-Admin-User-war\
This directory includes a common development structure (bold are checked out from the repository):
- build - compiled files
- dist - .war file
- nbproject - project files
- src - Java source code
- web - JSF pages, WEB-INF directory, CSS files, etc.
- build.xml - Ant script
JBoss Installation
The web application server is installed into:
C:\Apps\04-Tools\jboss-eap-6.2
Problem
The develop - deploy - test cycle is painfully slow. It can take upwards of 30 seconds to test a single change to a web page. Here's the current flow:
- Edit file in NetBeans.
- Save file.
- Shift+F11 (Run >> Clean and Build).
- Switch to browser tab (http://localhost:9990/console/App.html#deployments).
- Click Replace.
- Click Choose File.
- Select Project-Admin-User-war.war file.
- Click Open.
- Click Next.
- Click Save.
- Switch to browser tab (http://localhost:8080/admin/users/).
- F5 to reload the page.
The build (step 3) takes about 26 seconds; manual deployment adds to that.
Here's the ideal development cycle:
- Change a JSF page in NetBeans (note: this is a file checked out from repository).
- Save the JSF page.
- Alt+Tab to a browser window.
- F5 to reload the page.
It isn't as important to have hot deploy on Java source changes, as code development time tends to take much longer than simple web page layout changes.
Editing the exploded contents would mean developers are no longer editing files checked out from the repository and would therefore incur additional steps, or scripts, or possible loss of work.
Others have suggested the Deploy on save feature, which is disabled:
Another suggestion (as per the screen shot) is to run the application in debug mode, but selecting Debug >> Project (Ctrl+F5) didn't show page updates after changes.
Question
Is hot deploy of JSF pages possible using the given tools and constraints? If so, what are the exact steps required to achieve the ideal development cycle?
Standalone Configuration
The README.txt file shows that it is possible to "live deploy" content:
H) Manual mode only: Live replace portions of currently deployed unzipped content without redeploying:
cp -r target/example.war/foo.html $AS/standalone/deployments/example.war
Where the cp
command on Windows translates to:
xcopy /e /s /y src dest
This leads to:
- Open a command prompt.
- Change directory:
cd C:\Apps\04-Tools\jboss-eap-6.2\standalone\deployments
- Create skipdeploy to prevent deployment while copying is in progress:
type nul >> Project-Admin-User-war.war.skipdeploy
- Copy files to create a directory containing the files that have changed:
xcopy /i /y /e /s C:\Apps\07-Work\Project\Project-Admin\Project-Admin-User-war\web Project-Admin-User-war.war
Next:
- Delete skipdeploy:
rm Project-Admin-User-war.war.skipdeploy
- Create dodeploy:
type nul >> Project-Admin-User-war.war.dodeploy
- Return to the browser.
- Press F5 to refresh.
The result is that a resource bundle has gone missing: