This is a "ClickStart" that gets you going with a "Spring & AspectJ Load-time weaving in tomcat7" seed project starting point. You can launch it here:
This will setup a continuous deployment pipeline - a CloudBees Git repository, a Jenkins build compiling and running the test suite (on each commit). Should the build succeed, this seed app is deployed on a Tomcat 7 container.
You will see in this seed
- How to add a jar to the classpath of your CloudBees container (Tomcat7 -
$TOMCAT_HOME/lib
, Glassfish3, Glassfish4) via the$WAR_HOME/META-INF/lib
folder of your war file - How to use 9.8.4 Load-time weaving with AspectJ in the Spring Framework on a Tomcat7 CloudBees container (this would also apply to CloudBees' Glassfish 3 and 4 containers)
Sample with Maven and spring-instrument-tomcat-3.2.8.RELEASE.jar
<project>
<build>
<plugins>
<plugin>
<!--
(1) Copy spring-instrument-tomcat-3.2.8.RELEASE.jar to 'target/tomcat-extra-lib' folder during 'prepare-package' phase
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.springframework.</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>3.2.8.RELEASE</version>
<type>jar</type>
<outputDirectory>${project.build.directory}/tomcat-extra-lib
</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
<executions>
<execution>
<goals>
<goal>copy</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<plugin>
<!--
(1) Copy the content of the folder 'target/tomcat-extra-lib' in '$WAR_HOME/META-INF/lib'
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/tomcat-extra-lib</directory>
<targetPath>META-INF/lib</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>