maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Broyer <t.bro...@gmail.com>
Subject Re: Hot deployment using jetty 8 and maven
Date Thu, 10 Apr 2014 12:06:52 GMT
The usual workflow (I think) is to just use "mvn jetty:run" (without any
special configuration besides scanInterval) and have your IDE compile the
classes into target/classes, where the jetty-maven-plugin will look them
up:
http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html
If you don't use an IDE, then use any third-party tool to watch your files
and invoke "mvn process-classes" when they change.


On Thu, Apr 10, 2014 at 1:36 PM, Tom-Blank <blank_tom@rocketmail.com> wrote:

> 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
>
>


-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message