Skip to content

Commit 4d070d9

Browse files
committed
HSEARCH-5485 Use annotationProcessorPathsUseDepMgmt where applicable
1 parent 3aca3e1 commit 4d070d9

File tree

7 files changed

+16
-18
lines changed

7 files changed

+16
-18
lines changed

documentation/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,18 @@
138138
</testIncludes>
139139
<testExcludes combine.self="override" combine.children="override"></testExcludes>
140140
<showWarnings>false</showWarnings>
141+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
141142
<annotationProcessors>
142143
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
143144
</annotationProcessors>
144145
<annotationProcessorPaths>
145146
<path>
146147
<groupId>org.hibernate.search</groupId>
147148
<artifactId>hibernate-search-processor</artifactId>
148-
<version>${project.version}</version>
149149
</path>
150150
<path>
151151
<groupId>org.hibernate.search</groupId>
152152
<artifactId>hibernate-search-backend-elasticsearch</artifactId>
153-
<version>${project.version}</version>
154153
</path>
155154
</annotationProcessorPaths>
156155
</configuration>

documentation/src/main/asciidoc/public/reference/_static-metamodel-processor.adoc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ The annotation processor has to be added to the build, e.g. for Maven:
2222
<execution>
2323
<id>default-compile</id>
2424
<configuration>
25+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt> <1>
2526
<annotationProcessors>
26-
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor> <1>
27+
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor> <2>
2728
</annotationProcessors>
2829
<annotationProcessorPaths>
2930
<path>
3031
<groupId>org.hibernate.search</groupId>
31-
<artifactId>hibernate-search-processor</artifactId> <2>
32+
<artifactId>hibernate-search-processor</artifactId> <3>
3233
</path>
3334
<path>
3435
<groupId>org.hibernate.search</groupId>
35-
<artifactId>hibernate-search-backend-lucene</artifactId> <3>
36+
<artifactId>hibernate-search-backend-lucene</artifactId> <4>
3637
</path>
3738
</annotationProcessorPaths>
3839
</configuration>
@@ -41,9 +42,12 @@ The annotation processor has to be added to the build, e.g. for Maven:
4142
</plugin>
4243
----
4344
44-
<1> Provide the fully qualified class name of the annotation processor that generates the metamodel.
45-
<2> Add the `org.hibernate.search:hibernate-search-processor` dependency to the annotation processor path (a superset of the compile path), so the Java compiler can find the processor.
46-
<3> Add the backend dependency, in this example, the <<backend-lucene,Lucene backend>>, to the annotation processor path.
45+
<1> This setting is required for the annotation processor dependencies to be managed by the dependency management section.
46+
Particularly useful when using <<compatibility-search-dependencies-bom,Hibernate Search BOM>>.
47+
More information is available in https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPathsUseDepMgmt[Maven compiler plugin documentation].
48+
<2> Provide the fully qualified class name of the annotation processor that generates the metamodel.
49+
<3> Add the `org.hibernate.search:hibernate-search-processor` dependency to the annotation processor path (a superset of the compile path), so the Java compiler can find the processor.
50+
<4> Add the backend dependency, in this example, the <<backend-lucene,Lucene backend>>, to the annotation processor path.
4751
It is important to include the same backend that the application is using to make sure that the generated metamodel classes reflect all the backend specifics.
4852
For example, backends might have different defaults, resulting in a different set of <<mapping-inspect-traits,search traits>> per specific field, depending on the backend.
4953

integrationtest/metamodel/orm-elasticsearch/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,18 @@
6262
<id>default-testCompile</id>
6363
<configuration>
6464
<proc>full</proc>
65+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
6566
<annotationProcessors>
6667
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
6768
</annotationProcessors>
6869
<annotationProcessorPaths>
6970
<path>
7071
<groupId>org.hibernate.search</groupId>
7172
<artifactId>hibernate-search-processor</artifactId>
72-
<version>${project.version}</version>
7373
</path>
7474
<path>
7575
<groupId>org.hibernate.search</groupId>
7676
<artifactId>hibernate-search-backend-elasticsearch</artifactId>
77-
<version>${project.version}</version>
7877
</path>
7978
</annotationProcessorPaths>
8079
</configuration>

integrationtest/metamodel/orm-lucene/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,18 @@
6262
<id>default-testCompile</id>
6363
<configuration>
6464
<proc>full</proc>
65+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
6566
<annotationProcessors>
6667
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
6768
</annotationProcessors>
6869
<annotationProcessorPaths>
6970
<path>
7071
<groupId>org.hibernate.search</groupId>
7172
<artifactId>hibernate-search-processor</artifactId>
72-
<version>${project.version}</version>
7373
</path>
7474
<path>
7575
<groupId>org.hibernate.search</groupId>
7676
<artifactId>hibernate-search-backend-lucene</artifactId>
77-
<version>${project.version}</version>
7877
</path>
7978
</annotationProcessorPaths>
8079
</configuration>

integrationtest/metamodel/standalone-elasticsearch/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,18 @@
5353
<id>default-testCompile</id>
5454
<configuration>
5555
<proc>full</proc>
56+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
5657
<annotationProcessors>
5758
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
5859
</annotationProcessors>
5960
<annotationProcessorPaths>
6061
<path>
6162
<groupId>org.hibernate.search</groupId>
6263
<artifactId>hibernate-search-processor</artifactId>
63-
<version>${project.version}</version>
6464
</path>
6565
<path>
6666
<groupId>org.hibernate.search</groupId>
6767
<artifactId>hibernate-search-backend-elasticsearch</artifactId>
68-
<version>${project.version}</version>
6968
</path>
7069
</annotationProcessorPaths>
7170
</configuration>

integrationtest/metamodel/standalone-lucene/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,18 @@
5353
<id>default-testCompile</id>
5454
<configuration>
5555
<proc>full</proc>
56+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
5657
<annotationProcessors>
5758
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
5859
</annotationProcessors>
5960
<annotationProcessorPaths>
6061
<path>
6162
<groupId>org.hibernate.search</groupId>
6263
<artifactId>hibernate-search-processor</artifactId>
63-
<version>${project.version}</version>
6464
</path>
6565
<path>
6666
<groupId>org.hibernate.search</groupId>
6767
<artifactId>hibernate-search-backend-lucene</artifactId>
68-
<version>${project.version}</version>
6968
</path>
7069
</annotationProcessorPaths>
7170
</configuration>

lucene-next/documentation/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,18 @@
127127
</testIncludes>
128128
<testExcludes combine.self="override" combine.children="override"></testExcludes>
129129
<showWarnings>false</showWarnings>
130+
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
130131
<annotationProcessors>
131132
<annotationProcessor>org.hibernate.search.processor.HibernateSearchProcessor</annotationProcessor>
132133
</annotationProcessors>
133134
<annotationProcessorPaths>
134135
<path>
135136
<groupId>org.hibernate.search</groupId>
136137
<artifactId>hibernate-search-processor</artifactId>
137-
<version>${project.version}</version>
138138
</path>
139139
<path>
140140
<groupId>org.hibernate.search</groupId>
141141
<artifactId>hibernate-search-backend-elasticsearch</artifactId>
142-
<version>${project.version}</version>
143142
</path>
144143
</annotationProcessorPaths>
145144
</configuration>

0 commit comments

Comments
 (0)