Intersult Live is a product for live deployment of files.
Problem Description#
When developing web projects, the flow of creation is interrupted by redployments. Especially in projects with dependencies, using maven or other build processes. Changing some XHTML or Java-Code causes build, build of dependencies, redeploy and loss of server state.Solution#
Intersult Live connects resource and class loading to arbitrary paths. Each resource loading location, packed as JAR, WAR, EAR or unpacked can be mapped directly to a workspace location. Intersult Live is a very generic solution of resource loading redirect, thus it supports a large variety of application servers. It has been testet with Tomcat, JBoss and Glassfish without any problems.State of Development#
The project is very new. Currently the following features are supported:- reloading of resources like .XHTML or .properties files
- reloading of classes where with changes in method body only
- redirection of JAR-Entries to individual files in workspace
- redirection of JNDI-locations and other URLs
How it works#
- Download current version of http://repository.intersult.com/repository/com/intersult/live/1.0-SNAPSHOT/live-1.0-SNAPSHOT.jar
from Intersult repository.
- Place on some path on you local file system, prefered having no spaces inside
- Add -noverify -javaagent:<path>\1.0-SNAPSHOT\live-1.0-SNAPSHOT.jar to your JVM-Options, where <path> is local path to live-1.0-SNAPSHOT.jar
- Restart your application server and watch for ##### Starting Intersult Live ##### on the output or logfile
- Place a live.xml in your WARs, EARs and JARs
Example in Pure Java#
<?xml version="1.0" encoding="UTF-8"?> <live> <mapping source="C\:\Java\workspace-helios\com.intersult\public\jsf-desktop\target/classes" target="/"/> </live>
The live.xml has to be located in the root directory of the resulting JAR file. It is independent using \ or / as path separators, paths are normalized.
Examples with Maven 2#
If you use maven 2 for the build process, it is very nice to generate source path into the live.xml. Just active resource filtering for properties files:
<project>
...
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
</build>
...
</project>
After this step you are able to use ${...}-Expressions in live.xml files: Simply JAR:
<?xml version="1.0" encoding="UTF-8"?>
<live xmlns="http://intersult.com/live/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://intersult.com/live/1.0 http://repository.intersult.com/repository/com/intersult/live/1.0-SNAPSHOT/live.xsd ">
<mapping source="${project.build.directory}/classes" target="/"/>
</live>
JAR with resources:
<?xml version="1.0" encoding="UTF-8"?>
<live xmlns="http://intersult.com/live/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://intersult.com/live/1.0 http://repository.intersult.com/repository/com/intersult/live/1.0-SNAPSHOT/live.xsd ">
<mapping source="${project.build.directory}/classes" target="/">
<exclude path="/META-INF*"/>
</mapping>
<mapping source="${basedir}/src/main/resources" target="/"/>
</live>
WAR:
<?xml version="1.0" encoding="UTF-8"?>
<live xmlns="http://intersult.com/live/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://intersult.com/live/1.0 http://repository.intersult.com/repository/com/intersult/live/1.0-SNAPSHOT/live.xsd">
<mapping source="${project.build.directory}/classes" target="/WEB-INF/classes"/>
<mapping source="${basedir}/src/main/webapp" target="/" loader="jndi:/localhost/${project.name}">
<exclude path="/META-INF*"/>
</mapping>
</live>
XML Schema#
The live.xml definitions above references the live.xsd schema from intersult.com repository. Manually you can access the XML Schema Definition (XSD) at live.xsd
