Java – in IntelliJ, why should I clean up and build wars to see changes when I run Google App Engine locally?
I'm using the Google application engine to build wars, and I notice that whenever I make local changes, I don't apply them when I run locally I've found that the only way to see my changes is to run MVN clean, then make, then build artifacts, and then deploy This is a screenshot showing my configuration:
If I miss any of the above steps, restarting the server will not show any changes I have made I've used IntelliJ to make a lot of webapps that are not Google application engines, and I don't usually have to do that How can I avoid all these steps? They greatly increase the time required to restart the server
If it helps, this is my POM XML file:
<?xml version="1.0" encoding="UTF-8"?> <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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <groupId>com.myapp</groupId> <artifactId>myapp</artifactId> <properties> <appengine.app.version>1</appengine.app.version> <appengine.target.version>1.8.6</appengine.target.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <!-- Compile/runtime dependencies --> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-1.0-sdk</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>net.sourceforge.stripes</groupId> <artifactId>stripes</artifactId> <version>1.5.7</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-testing</artifactId> <version>${appengine.target.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-stubs</artifactId> <version>${appengine.target.version}</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <version>2.5.1</version> <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.3</version> <configuration> <archiveClasses>true</archiveClasses> <webResources> <!-- in order to interpolate version from pom into appengine-web.xml --> <resource> <directory>${basedir}/src/main/webapp/WEB-INF</directory> <filtering>true</filtering> <targetPath>WEB-INF</targetPath> </resource> <resource> <directory>${basedir}/src/main/generated</directory> <targetPath>src/main/generated</targetPath> </resource> <resource> <directory>${basedir}/src/main/scripts/img</directory> <targetPath>src/main/scripts/img</targetPath> </resource> </webResources> </configuration> </plugin> <plugin> <groupId>com.google.appengine</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>${appengine.target.version}</version> </plugin> </plugins> </build> </project>
Solution
If you are using War artefact, yes, you must clean up and make it, because it actually creates a war file and then deploys. In order to update the code in the war file, IntelliJ must recreate the whole war file, which is completed by cleaning (deleting) and doing it again
You should consider using War explodes artefact so that IntelliJ can update the required class / jar file without recreating the entire war file But I see in your screenshot that you are already using the artifact of war explosion. Maybe the problem is that you are trying to update the jar file you are using