maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom-Blank <blank_...@rocketmail.com>
Subject Hot deployment using jetty 8 and maven
Date Thu, 10 Apr 2014 11:36:25 GMT
I'm new to Maven, but would like to achieve a hot deployment while changing
source code (Java).

My environment:
 - Maven 3.2.1
 - JDK: 1.6
 - Jetty 8.1.14.v20131031

What I would like to achieve is: Everytime I change something in my
servlets, Maven picks it up and recompiles these files (if possible only
delta). Then, once it's done it should copy/move the *.class files into the
directory of my webapp. This approach is needed to speed up my development
cycle like I'm used to it from developing in Grails and GGTS.

I'm starting up the application by running: 
*mvn clean install war:inplace jetty:run*

And Here is what I have:


<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.springapp</groupId>
    <artifactId>jetty-template</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>jetty-template</name>

    <properties>
        <spring.version>3.2.0.RELEASE</spring.version>
        <jetty.version>2.2.3E</jetty.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>jetty-template</finalName>
        <outputDirectory>target/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.14.v20131031</version>
                <configuration>
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                   
<classesDirectory>${basedir}/src/main/webapp/WEB-INF/classes</classesDirectory>
                    <webAppConfig>
                       
<allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
                    </webAppConfig>
                    <scanTargets>
                       
<scanTarget>src/main/java/com/springapp/mvc</scanTarget>
                        <scanTarget>src/main/webapp/WEB-INF</scanTarget>
                    </scanTargets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

I can see, that maven realizes that files in source folder (src) had been
changed, but does not compile into the directory:
"*/src/main/webapp/WEB-INF/classes*"

I would really appreciate any help. I'm struggling with this issue now for 2
days... :(



--
View this message in context: http://maven.40175.n5.nabble.com/Hot-deployment-using-jetty-8-and-maven-tp5790839.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message