views:

309

answers:

3

Hi,

is there a way to point a maven target (with classess) path to jBoss instead of building .ear and deploying it everytime I edit some sources?

Thanks in advance, Etam.

A: 

Well, you could just symlink the directory inside the jboss deploy directory (or change the maven target dir property). But if you are editing java source, it will need a redeploy on each change anyway.

For that, it's easier to use the maven cargo plugin, it can (re)deploy your ear to a running j2ee server.

jor
+1  A: 

Try specifying the build directory in your pom.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycomp.build</groupId>
    <artifactId>build-base</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <build>
        <directory>/path/to/jboss/server/default/deploy</directory>
    </build>
</project>
jon077
A: 

There is this tool called JavaRebel which is a Java Agent that automatically reloads classes when they change. I forget if they support unexploded ear files, but in Jboss you can always deploy the ear as an exploded jar (directory) so to effect changes, you simply need to recompile the classes and update them and JavaRebel will update the running application on the fly. It works pretty decently too.

Nicholas