updated pom of the cms-suite

This commit is contained in:
Francesco Mangiacrapa 2024-10-17 16:59:13 +02:00
parent aace2f9c3f
commit 4152d6f17f
5 changed files with 18 additions and 29 deletions

View File

@ -164,13 +164,7 @@
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-health</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
<version>2.1.0</version>
</dependency>
<!-- Plugins related tests -->

View File

@ -7,8 +7,8 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.gcube.application.geoportal.service.health.GeoportalHealthCheck;
import org.gcube.application.geoportal.service.health.MongoHealthCheck;
import org.gcube.application.geoportal.service.rest.health.GeoportalHealthCheck;
import org.gcube.application.geoportal.service.rest.health.MongoHealthCheck;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,6 +1,4 @@
package org.gcube.application.geoportal.service.health;
import javax.enterprise.context.ApplicationScoped;
package org.gcube.application.geoportal.service.rest.health;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
@ -9,7 +7,7 @@ import org.eclipse.microprofile.health.Readiness;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@Readiness
@Liveness
@Slf4j
@ -20,7 +18,7 @@ public class GeoportalHealthCheck implements HealthCheck {
@Override
public HealthCheckResponse call() {
log.info(GeoportalHealthCheck.class.getSimpleName() + " call");
return HealthCheckResponse.named(SERVICE_NAME).state(true).withData("status", "healthy").build();
return HealthCheckResponse.named(SERVICE_NAME).status(true).withData("status", "healthy").build();
}
}

View File

@ -1,6 +1,4 @@
package org.gcube.application.geoportal.service.health;
import javax.enterprise.context.ApplicationScoped;
package org.gcube.application.geoportal.service.rest.health;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
@ -16,7 +14,6 @@ import com.mongodb.client.MongoIterable;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@Readiness
@Liveness
@Slf4j
@ -41,7 +38,7 @@ public class MongoHealthCheck implements HealthCheck {
ScopeProvider.instance.set(context);
mongo = ImplementationProvider.get().getProvidedObjectByClass(Mongo.class);
buildHCRBuilder = appendMongoInfo(buildHCRBuilder, mongo.getConnection());
buildHCRBuilder.state(true);
buildHCRBuilder.status(true);
MongoIterable<String> collections = mongo.getTheClient().getDatabase(mongo.getConnection().getDatabase())
.listCollectionNames();
log.info("listCollectionNames is null: {}", collections == null);
@ -53,7 +50,7 @@ public class MongoHealthCheck implements HealthCheck {
}
return buildHCRBuilder.build();
} catch (Exception e) {
buildHCRBuilder.state(false);
buildHCRBuilder.status(false);
if (mongo != null) {
MongoConnection connection = null;
try {

18
pom.xml
View File

@ -23,10 +23,10 @@
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
<!-- default properties -->
<gcube-smartgears-bom-version>2.5.1</gcube-smartgears-bom-version>
<storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range>
<plugin-framework-version>1.0.6</plugin-framework-version>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range>
<gcube-smartgears-bom-version>${gcube-smartgears-bom-version-p}</gcube-smartgears-bom-version>
<plugin-framework-version>${plugin-framework-version-p}</plugin-framework-version>
<authorization-utils-range>${authorization-utils-range-p}</authorization-utils-range>
</properties>
<profiles>
@ -39,9 +39,9 @@
</property>
</activation>
<properties>
<gcube-smartgears-bom-version>2.5.1</gcube-smartgears-bom-version>
<plugin-framework-version>1.0.6</plugin-framework-version>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range>
<gcube-smartgears-bom-version-p>2.5.1</gcube-smartgears-bom-version-p>
<plugin-framework-version-p>1.0.6</plugin-framework-version-p>
<authorization-utils-range-p>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range-p>
</properties>
</profile>
<!-- DEV profile -->
@ -53,9 +53,9 @@
</property>
</activation>
<properties>
<gcube-smartgears-bom-version>2.5.1-SNAPSHOT</gcube-smartgears-bom-version>
<plugin-framework-version>1.0.6-SNAPSHOT</plugin-framework-version>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range>
<gcube-smartgears-bom-version-p>2.5.1-SNAPSHOT</gcube-smartgears-bom-version-p>
<plugin-framework-version-p>1.0.6-SNAPSHOT</plugin-framework-version-p>
<authorization-utils-range-p>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range-p>
</properties>
</profile>
</profiles>