Maven in Eclipse: incremental builds

I look around for a while and cannot find a specific method for gradually creating Maven in Eclipse.

Maven is currently creating a .war file every time I make changes, which takes time to compile during the normal build process.

What is the easiest way to speed things up and just copy deltas into a directory?


My pom.xml file:

<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.mkyong.common</groupId> <artifactId>SpringMVC</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>SpringMVC Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <spring.version>3.1.2.RELEASE</spring.version> </properties> <dependencies> <!-- Spring 3 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>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <!-- JSON --> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.8</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.8</version> </dependency> <!-- DHTMLX --> <dependency> <groupId>com.mylaensys.dhtmlx.adapter</groupId> <artifactId>mylaensys-dhtmlx-adapter</artifactId> <version>1.1</version> </dependency> </dependencies> <build> <finalName>SpringMVC</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.2</version> <!-- <version>2.1-beta-1</version> --> <configuration> <overlay> <excludes> META-INF/**,scripts/menu.js,WEB-INF/*.txt,WEB-INF/jboss-web.xml,WEB-INF/web.xml </excludes> </overlay> <archiveClasses>true</archiveClasses> <warSourceDirectory> src/main/webapp </warSourceDirectory> <warSourceExcludes> WEB-INF/*.tld,WEB-INF/classes/** </warSourceExcludes> <outputDirectory> ${env.WAR_PATH} </outputDirectory> <archive> <manifest> <addClasspath>false</addClasspath> <classpathPrefix>lib/</classpathPrefix> </manifest> <addMavenDescriptor>true</addMavenDescriptor> </archive> </configuration> </plugin> </plugins> </build> </project> 
+4
source share
2 answers

By default, Maven should not create war during Eclipse compilation. Can you share your pom.xml?

0
source

My way to use the maven system (not eclipse internal maven):

  • Right click on the project β†’ Settings β†’ Builders
  • New ... β†’ Program
  • Set C:\Program Files\apache-maven-3.3.9\bin\mvn.cmd (your directory may be different) to "Location".
  • Set the folder in which you have pom.xml to "Working directory:"
  • Install war:war in Arguments :.
  • Switch to the Build Options panel and check "During automatic build."

Now, if you ever change the file (and save), mvn war:war is executed.

0
source

All Articles