I want to build WAR and then run JUnit tests on that WAR. Is this possible?
I have following in my pom. What changes I should make in order to achieve?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin-version}</version>
<configuration>
<webXml>WEB-INF/web.xml</webXml>
<webResources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<targetPath>WEB-INF/classes</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/sqls</directory>
<targetPath>WEB-INF/classes</targetPath>
</resource>
</webResources>
<outputFileNameMapping>@{groupId}@.@{artifactId}@-@{version}@.@{extension}@</outputFileNameMapping>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin-version}</version>
<configuration>
<argLine>-Xms256m -Xmx512m -XX:MaxMetaspaceSize=256m -XX:GCTimeRatio=19
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4
-XX:NewRatio=2 ${jvm.args.preferences} ${jvm.args.jacoco}</argLine>
</configuration>
</plugin>