DATAJPA-12 - Simplified build setup for meta-model creation.
Consolidated the generation of the static meta-model for test classes into the Querydsl APT plugin.
This commit is contained in:
88
pom.xml
88
pom.xml
@@ -144,12 +144,6 @@
|
||||
<version>${hibernate}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||
<version>1.2.0.Final</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.persistence</groupId>
|
||||
@@ -375,7 +369,10 @@
|
||||
<artifactId>apt-maven-plugin</artifactId>
|
||||
<version>${apt}</version>
|
||||
<configuration>
|
||||
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
|
||||
<processors>
|
||||
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
|
||||
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
|
||||
</processors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -385,7 +382,7 @@
|
||||
<goal>process</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>target/generated-sources/main</outputDirectory>
|
||||
<outputDirectory>target/generated-sources/annotations</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
@@ -395,7 +392,7 @@
|
||||
<goal>test-process</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>target/generated-sources/test</outputDirectory>
|
||||
<testOutputDirectory>target/generated-test-sources/test-annotations</testOutputDirectory>
|
||||
<options>
|
||||
<querydsl.excludedClasses>
|
||||
org.springframework.data.jpa.repository.util.JpaClassUtilsUnitTests.NamedUser,org.springframework.data.jpa.repository.query.ParameterBinderUnitTests.SampleEmbeddable
|
||||
@@ -404,6 +401,13 @@
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||
<version>1.2.0.Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -413,72 +417,6 @@
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>wagon-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<!-- configuration for JPA Metamodel generation
|
||||
as described here: http://stackoverflow.com/questions/18853585/maven-build-with-annotationprocessor-that-parses-files-in-src-main-java-and-gene
|
||||
-->
|
||||
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- normal compile and generation of other classes to standard location (implicit, you shouldn't need that) -->
|
||||
<id>default-compile</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<annotationProcessors>
|
||||
<annotationProcessor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</annotationProcessor>
|
||||
</annotationProcessors>
|
||||
<generatedSourcesDirectory>${project.build.directory}/generated-sources/test</generatedSourcesDirectory>
|
||||
<!-- generated class depends on test-scope libs, so don't compile now: proc:only DISABLES compilation of generated classes-->
|
||||
<proc>only</proc>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- implicit test-compile:testCompile -->
|
||||
</executions>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||
<version>1.2.0.Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<!--
|
||||
Adds source-dir during generate-test-sources:add-test-source
|
||||
so that the path to our generated class is now known to the
|
||||
compiler during test-compile:testCompile
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-test-source</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${project.build.directory}/generated-sources/test</source>
|
||||
<source>${project.build.directory}/generated-test-sources/test-annotations</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user