Added the annotation processor to the EM build to generate static entity model classes

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17808 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Hardy Ferentschik 2009-10-20 17:33:40 +00:00
parent 52c0d41f83
commit 00fbf234e1
2 changed files with 63 additions and 5 deletions

View File

@ -26,14 +26,12 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
@ -47,6 +45,12 @@
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.0.0-Alpha1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
@ -84,6 +88,60 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>process_annotations</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<echo>processing JPA annotations</echo>
<property name="target.dir" value="target/generated-jpamodel-classes"/>
<mkdir dir="${target.dir}"/>
<javac srcdir="src/test/java" destdir="${target.dir}"
failonerror="false" excludes="test/**" fork="true" executable="${jdk16_home}/bin/javac" target="1.5">
<compilerarg value="-proc:only"/>
<classpath>
<path refid="maven.test.classpath"/>
</classpath>
</javac>
</tasks>
<sourceRoot>generate</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-jpamodel-classes</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>

View File

@ -26,7 +26,6 @@
<module>connection-c3p0</module>
<module>connection-proxool</module>
<module>annotations</module>
<module>entitymanager</module>
<module>envers</module>
<module>jmx</module>
<module>testing</module>
@ -81,6 +80,7 @@
</property>
</activation>
<modules>
<module>entitymanager</module>
<module>cache-infinispan</module>
<module>jdbc4-testing</module>
</modules>