Skip to content

Commit cc763f2

Browse files
committed
Rework meta-model logic
1 parent a60443f commit cc763f2

File tree

3 files changed

+37
-75
lines changed

3 files changed

+37
-75
lines changed

demo/entities-metamodel/pom.xml

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<artifactId>entities-metamodel</artifactId>
1313

1414
<properties>
15-
<metamodel.sourceDir>${project.basedir}/../entities/src/main/java</metamodel.sourceDir>
16-
<project.generated.sources>${project.basedir}/src/gen/java/</project.generated.sources>
1715
<!-- Ignore auto generated code -->
1816
<sonar.exclusions>
1917
src/gen/java/**
@@ -25,64 +23,5 @@
2523
<groupId>software.xdev.sse.demo</groupId>
2624
<artifactId>entities</artifactId>
2725
</dependency>
28-
29-
<dependency>
30-
<groupId>org.hibernate.orm</groupId>
31-
<artifactId>hibernate-processor</artifactId>
32-
<optional>true</optional>
33-
</dependency>
3426
</dependencies>
35-
36-
<build>
37-
<plugins>
38-
<plugin>
39-
<groupId>org.codehaus.mojo</groupId>
40-
<artifactId>build-helper-maven-plugin</artifactId>
41-
<executions>
42-
<execution>
43-
<id>add-source-metamodel</id>
44-
<phase>generate-sources</phase>
45-
<goals>
46-
<goal>add-source</goal>
47-
</goals>
48-
<configuration>
49-
<sources>
50-
<source>${project.generated.sources}</source>
51-
</sources>
52-
</configuration>
53-
</execution>
54-
</executions>
55-
</plugin>
56-
57-
<plugin>
58-
<groupId>org.bsc.maven</groupId>
59-
<artifactId>maven-processor-plugin</artifactId>
60-
<executions>
61-
<execution>
62-
<id>process</id>
63-
<goals>
64-
<goal>process</goal>
65-
</goals>
66-
<phase>generate-sources</phase>
67-
<configuration>
68-
<sourceDirectory>${metamodel.sourceDir}</sourceDirectory>
69-
<outputDirectory>${project.generated.sources}</outputDirectory>
70-
<!-- Fix javac implicit warning by setting default value -->
71-
<!-- https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJJJAJ -->
72-
<!-- Disable @Generated otherwise it tries to use javax because some plugins contain javax.annotation.Generated -->
73-
<!-- https://hibernate.atlassian.net/browse/HHH-15877 -->
74-
<!-- @formatter:off DO NOT INTRODUCE LINE BREAK -->
75-
<compilerArguments>
76-
-implicit:class -AfullyAnnotationConfigured=true -AaddGeneratedAnnotation=false -Aindex=false
77-
</compilerArguments>
78-
<!-- @formatter:on -->
79-
<processors>
80-
<processor>org.hibernate.processor.HibernateProcessor</processor>
81-
</processors>
82-
</configuration>
83-
</execution>
84-
</executions>
85-
</plugin>
86-
</plugins>
87-
</build>
8827
</project>

demo/entities/pom.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,41 @@
2626
<artifactId>jakarta.validation-api</artifactId>
2727
</dependency>
2828
</dependencies>
29+
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-compiler-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<id>generate-meta-model</id>
38+
<goals>
39+
<goal>compile</goal>
40+
</goals>
41+
<phase>compile</phase>
42+
<configuration>
43+
<annotationProcessorPaths>
44+
<path>
45+
<groupId>org.hibernate.orm</groupId>
46+
<artifactId>hibernate-processor</artifactId>
47+
</path>
48+
</annotationProcessorPaths>
49+
<annotationProcessors>
50+
<annotationProcessor>org.hibernate.processor.HibernateProcessor</annotationProcessor>
51+
</annotationProcessors>
52+
<compilerArgs>
53+
<arg>-proc:only</arg>
54+
<arg>-AfullyAnnotationConfigured=true</arg>
55+
<arg>-AaddGeneratedAnnotation=false</arg>
56+
<arg>-Aindex=false</arg>
57+
</compilerArgs>
58+
<generatedSourcesDirectory>${project.basedir}/../entities-metamodel/src/gen/java/
59+
</generatedSourcesDirectory>
60+
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
</plugins>
65+
</build>
2966
</project>

demo/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,6 @@
199199
</configuration>
200200
</plugin>
201201

202-
<!-- Required for generating JPA classes -->
203-
<plugin>
204-
<groupId>org.codehaus.mojo</groupId>
205-
<artifactId>build-helper-maven-plugin</artifactId>
206-
<version>3.6.1</version>
207-
</plugin>
208-
209-
<!-- Required for generating JPA classes -->
210-
<plugin>
211-
<groupId>org.bsc.maven</groupId>
212-
<artifactId>maven-processor-plugin</artifactId>
213-
<version>5.1</version>
214-
</plugin>
215-
216202
<!-- Spring -->
217203
<plugin>
218204
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)