forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
131 changed files
with
7,039 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
196 changes: 196 additions & 0 deletions
196
extensions/hibernate-search-standalone-elasticsearch/deployment/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-hibernate-search-standalone-elasticsearch-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-hibernate-search-standalone-elasticsearch-deployment</artifactId> | ||
<name>Quarkus - Hibernate Search - Standalone + Elasticsearch - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-elasticsearch-rest-client-common-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-hibernate-search-standalone-elasticsearch</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-vertx-http-dev-ui-spi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-vertx-http-deployment-spi</artifactId> | ||
</dependency> | ||
|
||
<!-- test dependencies --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${project.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
<profiles> | ||
<profile> | ||
<id>test-elasticsearch</id> | ||
<activation> | ||
<property> | ||
<name>test-containers</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skip>false</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<profile> | ||
<id>docker-elasticsearch</id> | ||
<activation> | ||
<property> | ||
<name>start-containers</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<elasticsearch.hosts>localhost:9200</elasticsearch.hosts> | ||
<elasticsearch.protocol>http</elasticsearch.protocol> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<configuration> | ||
<images> | ||
<image> | ||
<name>${elasticsearch.image}</name> | ||
<alias>elasticsearch</alias> | ||
<run> | ||
<env> | ||
<discovery.type>single-node</discovery.type> | ||
<xpack.security.enabled>false</xpack.security.enabled> | ||
<ES_JAVA_OPTS>-Xms512m -Xmx512m</ES_JAVA_OPTS> | ||
<!-- Disable disk-based shard allocation thresholds: | ||
in a single-node setup they just don't make sense, | ||
and lead to problems on large disks with little space left. | ||
See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation | ||
--> | ||
<cluster.routing.allocation.disk.threshold_enabled>false</cluster.routing.allocation.disk.threshold_enabled> | ||
<!-- Disable some features that are not needed in our tests and just slow down startup --> | ||
<xpack.profiling.enabled>false</xpack.profiling.enabled> | ||
<xpack.monitoring.templates.enabled>false</xpack.monitoring.templates.enabled> | ||
<xpack.ml.enabled>false</xpack.ml.enabled> | ||
<xpack.watcher.enabled>false</xpack.watcher.enabled> | ||
<xpack.ent_search.enabled>false</xpack.ent_search.enabled> | ||
<stack.templates.enabled>false</stack.templates.enabled> | ||
<cluster.deprecation_indexing.enabled>false</cluster.deprecation_indexing.enabled> | ||
<indices.lifecycle.history_index_enabled>false</indices.lifecycle.history_index_enabled> | ||
<slm.history_index_enabled>false</slm.history_index_enabled> | ||
</env> | ||
<ports> | ||
<port>9200:9200</port> | ||
</ports> | ||
<log> | ||
<prefix>Elasticsearch: </prefix> | ||
<date>default</date> | ||
<color>cyan</color> | ||
</log> | ||
<wait> | ||
<http> | ||
<url>http://localhost:9200</url> | ||
<method>GET</method> | ||
<status>200</status> | ||
</http> | ||
<time>30000</time> | ||
</wait> | ||
</run> | ||
</image> | ||
</images> | ||
<allContainers>true</allContainers> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>docker-start</id> | ||
<phase>process-test-classes</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
<goal>start</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>docker-stop</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>docker-prune</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>${docker-prune.location}</executable> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
15 changes: 15 additions & 0 deletions
15
.../standalone/elasticsearch/deployment/HibernateSearchStandaloneAlwaysEnabledProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.quarkus.hibernate.search.standalone.elasticsearch.deployment; | ||
|
||
import io.quarkus.deployment.Feature; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
|
||
// Executed even if the extension is disabled, see https://github.com/quarkusio/quarkus/pull/26966/ | ||
class HibernateSearchStandaloneAlwaysEnabledProcessor { | ||
|
||
@BuildStep | ||
public FeatureBuildItem featureBuildItem() { | ||
return new FeatureBuildItem(Feature.HIBERNATE_SEARCH_ELASTICSEARCH); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...rch/standalone/elasticsearch/deployment/HibernateSearchStandaloneConfiguredBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.hibernate.search.standalone.elasticsearch.deployment; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class HibernateSearchStandaloneConfiguredBuildItem extends SimpleBuildItem { | ||
|
||
private final Set<String> backendNamesForIndexedEntities; | ||
private final Map<String, Set<String>> backendAndIndexNamesForSearchExtensions; | ||
private final Map<String, Object> preBootProperties; | ||
|
||
public HibernateSearchStandaloneConfiguredBuildItem(Set<String> backendNamesForIndexedEntities, | ||
Map<String, Set<String>> backendAndIndexNamesForSearchExtensions, | ||
Map<String, Object> preBootProperties) { | ||
this.backendNamesForIndexedEntities = backendNamesForIndexedEntities; | ||
this.backendAndIndexNamesForSearchExtensions = backendAndIndexNamesForSearchExtensions; | ||
this.preBootProperties = preBootProperties; | ||
} | ||
|
||
public Set<String> getBackendNamesForIndexedEntities() { | ||
return backendNamesForIndexedEntities; | ||
} | ||
|
||
public Map<String, Set<String>> getBackendAndIndexNamesForSearchExtensions() { | ||
return backendAndIndexNamesForSearchExtensions; | ||
} | ||
|
||
public Map<String, Object> getPreBootProperties() { | ||
return preBootProperties; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...earch/standalone/elasticsearch/deployment/HibernateSearchStandaloneDisabledProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.hibernate.search.standalone.elasticsearch.deployment; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.annotations.BuildSteps; | ||
import io.quarkus.deployment.annotations.ExecutionTime; | ||
import io.quarkus.deployment.annotations.Record; | ||
import io.quarkus.hibernate.search.standalone.elasticsearch.runtime.HibernateSearchStandaloneRecorder; | ||
import io.quarkus.hibernate.search.standalone.elasticsearch.runtime.HibernateSearchStandaloneRuntimeConfig; | ||
|
||
@BuildSteps(onlyIfNot = HibernateSearchStandaloneEnabled.class) | ||
class HibernateSearchStandaloneDisabledProcessor { | ||
@BuildStep | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
public void disableHibernateSearch(HibernateSearchStandaloneRecorder recorder, | ||
HibernateSearchStandaloneRuntimeConfig runtimeConfig) { | ||
recorder.checkNoExplicitActiveTrue(runtimeConfig); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ibernate/search/standalone/elasticsearch/deployment/HibernateSearchStandaloneEnabled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.hibernate.search.standalone.elasticsearch.deployment; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import io.quarkus.hibernate.search.standalone.elasticsearch.runtime.HibernateSearchStandaloneBuildTimeConfig; | ||
|
||
/** | ||
* Supplier that can be used to only run build steps | ||
* if the Hibernate Search extension is enabled. | ||
*/ | ||
public class HibernateSearchStandaloneEnabled implements BooleanSupplier { | ||
|
||
private final HibernateSearchStandaloneBuildTimeConfig config; | ||
|
||
HibernateSearchStandaloneEnabled(HibernateSearchStandaloneBuildTimeConfig config) { | ||
this.config = config; | ||
} | ||
|
||
@Override | ||
public boolean getAsBoolean() { | ||
return config.enabled(); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...earch/standalone/elasticsearch/deployment/HibernateSearchStandaloneManagementEnabled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.quarkus.hibernate.search.standalone.elasticsearch.deployment; | ||
|
||
import io.quarkus.hibernate.search.standalone.elasticsearch.runtime.HibernateSearchStandaloneBuildTimeConfig; | ||
import io.quarkus.hibernate.search.standalone.elasticsearch.management.HibernateSearchStandaloneManagementConfig; | ||
|
||
/** | ||
* Supplier that can be used to only run build steps | ||
* if the Hibernate Search extension and its management is enabled. | ||
*/ | ||
public class HibernateSearchStandaloneManagementEnabled extends HibernateSearchStandaloneEnabled { | ||
|
||
private final HibernateSearchStandaloneManagementConfig config; | ||
|
||
HibernateSearchStandaloneManagementEnabled(HibernateSearchStandaloneBuildTimeConfig config, | ||
HibernateSearchStandaloneManagementConfig managementConfig) { | ||
super(config); | ||
this.config = managementConfig; | ||
} | ||
|
||
@Override | ||
public boolean getAsBoolean() { | ||
return super.getAsBoolean() && config.enabled(); | ||
} | ||
|
||
} |
Oops, something went wrong.