Skip to content

Commit

Permalink
Document compile-time weaving workaround for SPR-8523
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeams committed Jul 21, 2011
1 parent 83d4081 commit 8e0c537
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SPR-8523/README.markdown
Expand Up @@ -9,3 +9,9 @@ You'll notice in the pom that tests are being run with

-javaagent:/path/to/org.springframework.instrument.jar


Workaround: Use compile time weaving instead

1. Repeat steps 2 and 3 above to cause the build to fail
2. copy `pom-compile-time-weaving.xml` to `pom.xml` (you may want to diff these two files first to understand what's changed)
3. run `mvn test`; note BUILD SUCCESSFUL
120 changes: 120 additions & 0 deletions SPR-8523/pom-compile-time-weaving.xml
@@ -0,0 +1,120 @@
<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>org.springframework.issues</groupId>
<artifactId>SPR-8523</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Spring Issue Reproduction Project</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-maven-snapshot</id>
<name>Springframework Maven Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>maven-central</id>
<name>Maven Central Repository</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
<org.springframework.version>3.1.0.BUILD-SNAPSHOT</org.springframework.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
<excludes>
<exclude>**/*Abstract*.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<includes>**/*/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>2.1.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 8e0c537

Please sign in to comment.