|
12 | 12 | <description>Demonstrates how to use the Elasticsearch backend for Hibernate Search</description>
|
13 | 13 |
|
14 | 14 | <properties>
|
| 15 | + <compiler-plugin.version>3.11.0</compiler-plugin.version> |
| 16 | + <surefire-plugin.version>3.0.0</surefire-plugin.version> |
15 | 17 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
16 | 18 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
17 |
| - <maven.compiler.source>1.8</maven.compiler.source> |
18 |
| - <maven.compiler.target>1.8</maven.compiler.target> |
| 19 | + <maven.compiler.release>17</maven.compiler.release> |
19 | 20 |
|
20 |
| - <version.org.hibernate.search>5.11.3.Final</version.org.hibernate.search> |
21 |
| - <version.org.hibernate.orm>5.4.5.Final</version.org.hibernate.orm> |
22 |
| - <test.elasticsearch.host.version>5.6.8</test.elasticsearch.host.version> |
| 21 | + <version.org.hibernate.search>6.2.0.CR1</version.org.hibernate.search> |
| 22 | + <version.org.hibernate.orm>5.6.15.Final</version.org.hibernate.orm> |
| 23 | + |
| 24 | + <docker-maven-plugin.version>0.34.1</docker-maven-plugin.version> |
| 25 | + <test.containers.run.skip>false</test.containers.run.skip> |
| 26 | + <test.elasticsearch.run.skip>false</test.elasticsearch.run.skip> |
| 27 | + <test.elasticsearch.run.image.name>elastic/elasticsearch</test.elasticsearch.run.image.name> |
| 28 | + <test.elasticsearch.run.image.tag>7.17.0</test.elasticsearch.run.image.tag> |
23 | 29 | </properties>
|
24 | 30 |
|
25 | 31 | <prerequisites>
|
26 |
| - <maven>3.0</maven> |
| 32 | + <maven>3.9</maven> |
27 | 33 | </prerequisites>
|
28 | 34 |
|
29 | 35 | <dependencies>
|
30 | 36 | <!-- Compile -->
|
31 | 37 | <dependency>
|
32 |
| - <groupId>org.hibernate</groupId> |
33 |
| - <artifactId>hibernate-search-orm</artifactId> |
| 38 | + <groupId>org.hibernate.search</groupId> |
| 39 | + <artifactId>hibernate-search-mapper-orm</artifactId> |
34 | 40 | <version>${version.org.hibernate.search}</version>
|
35 | 41 | </dependency>
|
36 | 42 | <dependency>
|
37 |
| - <groupId>org.hibernate</groupId> |
38 |
| - <artifactId>hibernate-search-elasticsearch</artifactId> |
| 43 | + <groupId>org.hibernate.search</groupId> |
| 44 | + <artifactId>hibernate-search-backend-elasticsearch</artifactId> |
39 | 45 | <version>${version.org.hibernate.search}</version>
|
40 | 46 | </dependency>
|
41 | 47 | <dependency>
|
42 | 48 | <groupId>org.hibernate</groupId>
|
43 |
| - <artifactId>hibernate-entitymanager</artifactId> |
| 49 | + <artifactId>hibernate-core</artifactId> |
44 | 50 | <version>${version.org.hibernate.orm}</version>
|
45 | 51 | </dependency>
|
46 | 52 |
|
|
54 | 60 | <dependency>
|
55 | 61 | <groupId>com.h2database</groupId>
|
56 | 62 | <artifactId>h2</artifactId>
|
57 |
| - <version>1.4.178</version> |
| 63 | + <version>2.1.214</version> |
58 | 64 | <scope>test</scope>
|
59 | 65 | </dependency>
|
60 | 66 | <dependency>
|
|
67 | 73 |
|
68 | 74 | <build>
|
69 | 75 | <plugins>
|
| 76 | + <plugin> |
| 77 | + <artifactId>maven-compiler-plugin</artifactId> |
| 78 | + <version>${compiler-plugin.version}</version> |
| 79 | + <configuration> |
| 80 | + <compilerArgs> |
| 81 | + <compilerArg>-parameters</compilerArg> |
| 82 | + </compilerArgs> |
| 83 | + </configuration> |
| 84 | + </plugin> |
| 85 | + <plugin> |
| 86 | + <artifactId>maven-surefire-plugin</artifactId> |
| 87 | + <version>${surefire-plugin.version}</version> |
| 88 | + </plugin> |
| 89 | + <!-- This is only necessary because Hibernate Search |
| 90 | + never builds Jandex indexes for classes in the org.hibernate package --> |
| 91 | + <plugin> |
| 92 | + <groupId>org.jboss.jandex</groupId> |
| 93 | + <artifactId>jandex-maven-plugin</artifactId> |
| 94 | + <version>1.2.3</version> |
| 95 | + <executions> |
| 96 | + <execution> |
| 97 | + <id>make-index</id> |
| 98 | + <goals> |
| 99 | + <goal>jandex</goal> |
| 100 | + </goals> |
| 101 | + </execution> |
| 102 | + </executions> |
| 103 | + </plugin> |
70 | 104 | <plugin>
|
71 | 105 | <groupId>org.apache.maven.plugins</groupId>
|
72 | 106 | <artifactId>maven-failsafe-plugin</artifactId>
|
73 |
| - <version>2.19.1</version> |
| 107 | + <version>${surefire-plugin.version}</version> |
74 | 108 | <executions>
|
75 | 109 | <execution>
|
76 | 110 | <goals>
|
|
84 | 118 | </executions>
|
85 | 119 | </plugin>
|
86 | 120 | <plugin>
|
87 |
| - <groupId>com.github.alexcojocaru</groupId> |
88 |
| - <artifactId>elasticsearch-maven-plugin</artifactId> |
89 |
| - <version>5.11</version> |
| 121 | + <groupId>io.fabric8</groupId> |
| 122 | + <artifactId>docker-maven-plugin</artifactId> |
| 123 | + <version>${docker-maven-plugin.version}</version> |
90 | 124 | <configuration>
|
91 |
| - <clusterName>HibernateSearchDemoCluster</clusterName> |
92 |
| - <httpPort>9200</httpPort> |
93 |
| - <version>${test.elasticsearch.host.version}</version> |
| 125 | + <skip>${test.containers.run.skip}</skip> |
| 126 | + <startParallel>true</startParallel> |
| 127 | + <images> |
| 128 | + <image> |
| 129 | + <name>${test.elasticsearch.run.image.name}:${test.elasticsearch.run.image.tag}</name> |
| 130 | + <alias>elasticsearch</alias> |
| 131 | + <run> |
| 132 | + <skip>${test.elasticsearch.run.skip}</skip> |
| 133 | + <env> |
| 134 | + <logger.level>WARN</logger.level> |
| 135 | + <discovery.type>single-node</discovery.type> |
| 136 | + <!-- Limit the RAM usage. |
| 137 | + Recent versions of ES limit themselves to 50% of the total available RAM, |
| 138 | + but on CI this is sometimes too much, as we also have the Maven JVM |
| 139 | + and the JVM that runs tests taking up a significant amount of RAM, |
| 140 | + leaving too little for filesystem caches and resulting in freezes. |
| 141 | + --> |
| 142 | + <ES_JAVA_OPTS>-Xms1g -Xmx1g</ES_JAVA_OPTS> |
| 143 | + </env> |
| 144 | + <ports> |
| 145 | + <port>9200:9200</port> |
| 146 | + </ports> |
| 147 | + <log> |
| 148 | + <prefix>Elasticsearch: </prefix> |
| 149 | + <date>default</date> |
| 150 | + <color>cyan</color> |
| 151 | + </log> |
| 152 | + <wait> |
| 153 | + <http> |
| 154 | + <url>http://localhost:9200</url> |
| 155 | + <method>GET</method> |
| 156 | + <status>200</status> |
| 157 | + </http> |
| 158 | + <time>20000</time> |
| 159 | + </wait> |
| 160 | + </run> |
| 161 | + </image> |
| 162 | + </images> |
94 | 163 | </configuration>
|
95 | 164 | <executions>
|
96 | 165 | <execution>
|
97 |
| - <id>start-elasticsearch</id> |
| 166 | + <id>docker-start</id> |
98 | 167 | <phase>pre-integration-test</phase>
|
99 | 168 | <goals>
|
100 |
| - <goal>runforked</goal> |
| 169 | + <!-- Stops all images currently running before starting them again. |
| 170 | + Useful to stop processes still running from a previously failed integration test run. |
| 171 | + Because this is invoked before the start goal, |
| 172 | + this will stop all images defined in the configuration, not just those we will start. |
| 173 | + --> |
| 174 | + <goal>stop</goal> |
| 175 | + <goal>start</goal> |
101 | 176 | </goals>
|
102 | 177 | </execution>
|
103 | 178 | <execution>
|
104 |
| - <id>stop-elasticsearch</id> |
| 179 | + <id>docker-stop</id> |
105 | 180 | <phase>post-integration-test</phase>
|
106 | 181 | <goals>
|
107 | 182 | <goal>stop</goal>
|
|
0 commit comments