Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt
hiddentrue

How to enhance classes from Maven2

Until somebody

There is a sandbox plugin to enhance with Maven available at http://mojo.codehaus.org/openjpa-maven-plugin/usage.html.

Alternately, enhancement can be performed by using the antrun plugin to launch the command-line enhancement tool on your classes writes a custom maven2 plugin for the openjpa enhancer, a simple way to do this is to invoke an ant script from maven like this:

No Format
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <configuration>
              <tasks>
                <java classname="org.apache.openjpa.enhance.PCEnhancer"
                      classpathref="maven.runtime.classpath"
                      dir="target/classes" fork="true" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>