solved issue with jakarta

This commit is contained in:
lucio 2024-03-01 18:11:44 +01:00
parent 639f76cbe4
commit 42ae8c5d3d
4 changed files with 21 additions and 40 deletions

View File

@ -1,4 +1,4 @@
FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9 FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat10.1.19
COPY ./docker/logback.xml /etc/ COPY ./docker/logback.xml /etc/
COPY ./docker/container.ini /etc/ COPY ./docker/container.ini /etc/

View File

@ -8,10 +8,15 @@
A gcube HelloWorld service - smartgears 4 A gcube HelloWorld service - smartgears 4
</description> </description>
<servlet> <servlet>
<servlet-name>org.gcube.service.helloworld.HelloWorld</servlet-name> <servlet-name>HelloWorld</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.gcube.service.helloworld.services</param-value>
</init-param>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>
<servlet-name>org.gcube.service.helloworld.HelloWorld</servlet-name> <servlet-name>HelloWorld</servlet-name>
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</servlet-mapping> </servlet-mapping>
</web-app> </web-app>

21
pom.xml
View File

@ -2,7 +2,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.service</groupId> <groupId>org.gcube.service</groupId>
<artifactId>helloworld</artifactId> <artifactId>helloworld</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
@ -31,7 +31,8 @@
scm:git:https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</connection> scm:git:https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</connection>
<developerConnection> <developerConnection>
scm:git:https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</developerConnection> scm:git:https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</url> <url>
https://code-repo.d4science.org/gCubeSystem/hello-world-sg4-service.git</url>
</scm> </scm>
<dependencyManagement> <dependencyManagement>
@ -47,8 +48,8 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<!-- <dependency> <!-- <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client-jakarta</artifactId> <artifactId>keycloak-admin-client-jakarta</artifactId>
<version>21.1.2</version> <version>21.1.2</version>
@ -82,12 +83,14 @@
<artifactId>jersey-container-servlet</artifactId> <artifactId>jersey-container-servlet</artifactId>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-cdi2-se -->
<!--
https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-cdi2-se -->
<dependency> <dependency>
<groupId>org.glassfish.jersey.inject</groupId> <groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId> <artifactId>jersey-cdi2-se</artifactId>
</dependency> </dependency>
<!-- add jackson as json provider --> <!-- add jackson as json provider -->
<dependency> <dependency>
@ -104,7 +107,8 @@
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<plugins> <plugins>
<!-- OPTIONAL generate the war in a different folder, that will be mounted on docker <!-- OPTIONAL generate the war in a different folder, that will be
mounted on docker
container --> container -->
<!-- <plugin> <!-- <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -116,7 +120,8 @@
</configuration> </configuration>
</plugin> --> </plugin> -->
<!-- OPTIONAL. authorization-control-library: add this plugin if you want to use gcube <!-- OPTIONAL. authorization-control-library: add this plugin if you
want to use gcube
authorization control funzionalities --> authorization control funzionalities -->
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>

View File

@ -1,29 +0,0 @@
package org.gcube.service.helloworld;
import java.util.HashSet;
import java.util.Set;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
import org.gcube.service.helloworld.services.AuthenticatedService;
import org.gcube.service.helloworld.services.ExcludeAuthorizationService;
import org.gcube.service.helloworld.services.HelloService;
/**
*
* @author Lucio Lelii (ISTI-CNR)
*/
@ApplicationPath("")
public class HelloWorld extends Application {
public Set<Class<?>> getClasses() {
final Set<Class<?>> classes = new HashSet<Class<?>>();
// register resources classes implementing Servlets
classes.add(HelloService.class);
classes.add(ExcludeAuthorizationService.class);
classes.add(AuthenticatedService.class);
return classes;
}
}