Building your Project with Maven
How to build test jar and include in your war or final jar
- Build your jar and test jar for the module.
- When building the war, add test jar as dependency which causes the test jar to be included in the war.
Adding Resources to your jar
Simply add following entry to your build
<build> <resources> <resource> <directory>src/main/resources </directory> <includes> <include>**/*.xml </include> </includes> </resource> </resources> </build>
Copying your dependencies in the jar
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.example:foo</include>
</includes>
</artifactSet>
<outputDirectory>target/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Build a jar with test classes.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
Jenkins Setup
Wiki setting up Jenkins in Ubuntu on
- https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
- http://emma.sourceforge.net/samples.html
Reference
- Apache Maven include/Exclude resources
- Oracle Maven Document
- A short blog on Maven Project
- HTML Tags in W3School
- https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
- http://emma.sourceforge.net/samples.html