diff --git a/bom/pom.xml b/bom/pom.xml index e016a143..8b49b31f 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/common/pom.xml b/common/pom.xml index 89c6f745..9a55db08 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -50,8 +50,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/common/src/main/java/com/kumuluz/ee/common/KumuluzServer.java b/common/src/main/java/com/kumuluz/ee/common/KumuluzServer.java index 4f5337cd..58cef1dc 100644 --- a/common/src/main/java/com/kumuluz/ee/common/KumuluzServer.java +++ b/common/src/main/java/com/kumuluz/ee/common/KumuluzServer.java @@ -17,16 +17,11 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.common; import com.kumuluz.ee.common.config.ServerConfig; -import java.util.EventListener; -import java.util.Map; - -import javax.servlet.Servlet; - /** * @author Tilen Faganel * @since 1.0.0 diff --git a/common/src/main/java/com/kumuluz/ee/common/ServletServer.java b/common/src/main/java/com/kumuluz/ee/common/ServletServer.java index c7e0ae5c..0d0ae18f 100644 --- a/common/src/main/java/com/kumuluz/ee/common/ServletServer.java +++ b/common/src/main/java/com/kumuluz/ee/common/ServletServer.java @@ -21,12 +21,12 @@ package com.kumuluz.ee.common; import com.kumuluz.ee.common.servlet.ServletWrapper; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.Servlet; +import jakarta.transaction.UserTransaction; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.Servlet; import javax.sql.DataSource; -import javax.transaction.UserTransaction; import java.util.*; /** diff --git a/common/src/main/java/com/kumuluz/ee/common/filters/PoweredByFilter.java b/common/src/main/java/com/kumuluz/ee/common/filters/PoweredByFilter.java index 5c5f0ef1..12303c93 100644 --- a/common/src/main/java/com/kumuluz/ee/common/filters/PoweredByFilter.java +++ b/common/src/main/java/com/kumuluz/ee/common/filters/PoweredByFilter.java @@ -17,11 +17,12 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.common.filters; -import javax.servlet.*; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletResponse; + import java.io.IOException; public class PoweredByFilter implements Filter { diff --git a/common/src/test/java/com/kumuluz/ee/configuration/utils/ConfigurationInterpolationUtilTest.java b/common/src/test/java/com/kumuluz/ee/configuration/utils/ConfigurationInterpolationUtilTest.java index 27b0ba1d..ff57a93c 100644 --- a/common/src/test/java/com/kumuluz/ee/configuration/utils/ConfigurationInterpolationUtilTest.java +++ b/common/src/test/java/com/kumuluz/ee/configuration/utils/ConfigurationInterpolationUtilTest.java @@ -1,12 +1,12 @@ package com.kumuluz.ee.configuration.utils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; import java.util.Optional; import java.util.function.Function; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Tests for {@link ConfigurationInterpolationUtil}. More tests of interpolation (expressions) are in @@ -15,7 +15,7 @@ * @author Urban Malc * @since 4.1.0 */ -public class ConfigurationInterpolationUtilTest { +class ConfigurationInterpolationUtilTest { private static final String TEST_VALUE = "TEST_VALUE"; @@ -37,7 +37,7 @@ private Function> createMapResolver(Map } @Test - public void noInterpolationTest() { + void noInterpolationTest() { assertEquals("test", ConfigurationInterpolationUtil.interpolateString("test", this::emptyResolver)); assertEquals("", ConfigurationInterpolationUtil.interpolateString("", this::emptyResolver)); @@ -52,7 +52,7 @@ public void noInterpolationTest() { } @Test - public void simpleInterpolationTest() { + void simpleInterpolationTest() { assertEquals(TEST_VALUE, ConfigurationInterpolationUtil.interpolateString("${replaceme}", this::testValueResolver)); assertEquals("abc" + TEST_VALUE, ConfigurationInterpolationUtil.interpolateString("abc${replaceme}", this::testValueResolver)); @@ -63,7 +63,7 @@ public void simpleInterpolationTest() { } @Test - public void nestedInterpolationTest() { + void nestedInterpolationTest() { assertEquals("i1", ConfigurationInterpolationUtil.interpolateString("${${i1}}", this::identityResolver)); assertEquals("i1i2", ConfigurationInterpolationUtil.interpolateString("${i1${i2}}", this::identityResolver)); @@ -77,7 +77,7 @@ public void nestedInterpolationTest() { } @Test - public void defaultValueInterpolationTest() { + void defaultValueInterpolationTest() { assertEquals("defaultValue", ConfigurationInterpolationUtil.interpolateString("${test:defaultValue}", this::emptyResolver)); assertEquals("defaultValue", ConfigurationInterpolationUtil.interpolateString("${:defaultValue}", this::emptyResolver)); @@ -90,7 +90,7 @@ public void defaultValueInterpolationTest() { } @Test - public void defaultValueAndNestedInterpolationTest() { + void defaultValueAndNestedInterpolationTest() { assertEquals("defaultValue", ConfigurationInterpolationUtil.interpolateString("${first:${second:defaultValue}}", this::emptyResolver)); assertEquals("secondValue", ConfigurationInterpolationUtil.interpolateString("${first:${second:defaultValue}}", diff --git a/components/bean-validation/hibernate-validator/pom.xml b/components/bean-validation/hibernate-validator/pom.xml index dde353fb..1d9a28ac 100644 --- a/components/bean-validation/hibernate-validator/pom.xml +++ b/components/bean-validation/hibernate-validator/pom.xml @@ -5,7 +5,7 @@ kumuluzee-bean-validation com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -62,7 +62,7 @@ org.glassfish.hk2.external - javax.inject + jakarta.inject org.glassfish.jersey.core @@ -81,23 +81,23 @@ hibernate-validator - javax.el - javax.el-api + jakarta.el + jakarta.el-api - org.glassfish.web - javax.el + org.glassfish + jakarta.el - javax.ws.rs - javax.ws.rs-api + jakarta.ws.rs + jakarta.ws.rs-api - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java index 210899a9..ef486947 100644 --- a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java +++ b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java @@ -22,14 +22,15 @@ import com.kumuluz.ee.beanvalidation.test.beans.Project; import com.kumuluz.ee.beanvalidation.test.beans.User; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.util.ArrayList; import java.util.Date; import java.util.Set; @@ -41,14 +42,14 @@ public class HibernateValidatorTest { private static Validator validator; - @BeforeClass + @BeforeAll public static void setUp() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); validator = factory.getValidator(); } @Test - public void testCorrectEntities() { + void testCorrectEntities() { Project p1 = new Project(); p1.setName("Test project"); @@ -70,12 +71,12 @@ public void testCorrectEntities() { Set> constraintViolations = validator.validate(u1); - Assert.assertNotNull(constraintViolations); - Assert.assertEquals(0, constraintViolations.size()); + Assertions.assertNotNull(constraintViolations); + Assertions.assertEquals(0, constraintViolations.size()); } @Test - public void testWrongEntities() { + void testWrongEntities() { Project p1 = new Project(); p1.setName("T"); @@ -96,7 +97,7 @@ public void testWrongEntities() { Set> constraintViolations = validator.validate(u1); - Assert.assertNotNull(constraintViolations); - Assert.assertEquals(4, constraintViolations.size()); + Assertions.assertNotNull(constraintViolations); + Assertions.assertEquals(4, constraintViolations.size()); } } diff --git a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/Project.java b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/Project.java index 426c2376..316f8c8a 100644 --- a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/Project.java +++ b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/Project.java @@ -20,8 +20,8 @@ */ package com.kumuluz.ee.beanvalidation.test.beans; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; /** * @author Tilen diff --git a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/User.java b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/User.java index 84ebb94b..52c2c454 100644 --- a/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/User.java +++ b/components/bean-validation/hibernate-validator/src/test/java/com/kumuluz/ee/beanvalidation/test/beans/User.java @@ -20,11 +20,11 @@ */ package com.kumuluz.ee.beanvalidation.test.beans; -import javax.validation.Valid; -import javax.validation.constraints.Email; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.util.Date; import java.util.List; diff --git a/components/bean-validation/pom.xml b/components/bean-validation/pom.xml index 707efcac..d4dc4aae 100644 --- a/components/bean-validation/pom.xml +++ b/components/bean-validation/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/cdi/pom.xml b/components/cdi/pom.xml index 38d5f6fe..129825cc 100644 --- a/components/cdi/pom.xml +++ b/components/cdi/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/cdi/weld/pom.xml b/components/cdi/weld/pom.xml index 47ea9587..938e3a8e 100644 --- a/components/cdi/weld/pom.xml +++ b/components/cdi/weld/pom.xml @@ -5,7 +5,7 @@ kumuluzee-cdi com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -34,32 +34,13 @@ jakarta.el jakarta.el-api - - org.jboss.weld.servlet - weld-servlet-core - ${weld.version} - - - org.jboss.spec.javax.annotation - jboss-annotations-api_1.3_spec - - - org.jboss.spec.javax.el - jboss-el-api_3.0_spec - - - org.jboss.spec.javax.interceptor - jboss-interceptors-api_1.2_spec - - - org.jboss.logging - jboss-logging - - + jakarta.enterprise + jakarta.enterprise.cdi-api + - org.jboss + io.smallrye jandex @@ -73,8 +54,8 @@ ${jersey.version} - javax.ws.rs - javax.ws.rs-api + jakarta.ws.rs + jakarta.ws.rs-api diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigBundle.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigBundle.java index 79754cbc..4d597ae2 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigBundle.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigBundle.java @@ -20,8 +20,9 @@ */ package com.kumuluz.ee.configuration.cdi; -import javax.enterprise.util.Nonbinding; -import javax.interceptor.InterceptorBinding; +import jakarta.enterprise.util.Nonbinding; +import jakarta.interceptor.InterceptorBinding; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigValue.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigValue.java index 7f74bc45..27564610 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigValue.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/ConfigValue.java @@ -17,10 +17,11 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.configuration.cdi; -import javax.enterprise.util.Nonbinding; +import jakarta.enterprise.util.Nonbinding; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/interceptors/ConfigBundleInterceptor.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/interceptors/ConfigBundleInterceptor.java index e7d75085..1790753b 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/interceptors/ConfigBundleInterceptor.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/interceptors/ConfigBundleInterceptor.java @@ -24,11 +24,11 @@ import com.kumuluz.ee.configuration.cdi.ConfigBundle; import com.kumuluz.ee.configuration.cdi.ConfigValue; import com.kumuluz.ee.configuration.utils.ConfigurationUtil; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Priority; +import jakarta.interceptor.Interceptor; +import jakarta.interceptor.InvocationContext; -import javax.annotation.PostConstruct; -import javax.annotation.Priority; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/ConfigurationUtilProducer.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/ConfigurationUtilProducer.java index 3ae8e60d..fc516ec2 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/ConfigurationUtilProducer.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/ConfigurationUtilProducer.java @@ -17,13 +17,13 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.configuration.cdi.producers; import com.kumuluz.ee.configuration.utils.ConfigurationUtil; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; /** * @author Tilen Faganel diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/EeConfigProducer.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/EeConfigProducer.java index 685b3384..f449baea 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/EeConfigProducer.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/configuration/cdi/producers/EeConfigProducer.java @@ -21,9 +21,8 @@ package com.kumuluz.ee.configuration.cdi.producers; import com.kumuluz.ee.common.config.EeConfig; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; /** * @author Tilen Faganel diff --git a/components/cdi/weld/src/main/java/com/kumuluz/ee/runtime/cdi/producers/EeRuntimeProducer.java b/components/cdi/weld/src/main/java/com/kumuluz/ee/runtime/cdi/producers/EeRuntimeProducer.java index 7b5297a6..fdb549a7 100644 --- a/components/cdi/weld/src/main/java/com/kumuluz/ee/runtime/cdi/producers/EeRuntimeProducer.java +++ b/components/cdi/weld/src/main/java/com/kumuluz/ee/runtime/cdi/producers/EeRuntimeProducer.java @@ -21,9 +21,8 @@ package com.kumuluz.ee.runtime.cdi.producers; import com.kumuluz.ee.common.runtime.EeRuntime; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; /** * @author Tilen Faganel diff --git a/components/el/pom.xml b/components/el/pom.xml index 81ca3c64..a8c64fda 100644 --- a/components/el/pom.xml +++ b/components/el/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/el/uel/pom.xml b/components/el/uel/pom.xml index 34110325..6bed5b2a 100644 --- a/components/el/uel/pom.xml +++ b/components/el/uel/pom.xml @@ -5,7 +5,7 @@ kumuluzee-el com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/components/javamail/pom.xml b/components/javamail/pom.xml index 785b4bca..43c856df 100644 --- a/components/javamail/pom.xml +++ b/components/javamail/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/javamail/ri/pom.xml b/components/javamail/ri/pom.xml index df5b3df1..e97f01db 100644 --- a/components/javamail/ri/pom.xml +++ b/components/javamail/ri/pom.xml @@ -5,7 +5,7 @@ kumuluzee-javamail com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -22,7 +22,7 @@ com.sun.mail - javax.mail + jakarta.mail ${javamail-ri.version} diff --git a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/JavaMailComponent.java b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/JavaMailComponent.java index 673646ab..41ca8e1a 100644 --- a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/JavaMailComponent.java +++ b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/JavaMailComponent.java @@ -7,8 +7,8 @@ import com.kumuluz.ee.common.dependencies.EeComponentDef; import com.kumuluz.ee.common.dependencies.EeComponentType; import com.kumuluz.ee.common.wrapper.KumuluzServerWrapper; +import jakarta.mail.Session; -import javax.mail.Session; import java.util.logging.Logger; /** diff --git a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/MailSessionFactory.java b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/MailSessionFactory.java index d707bff0..f6acc9f4 100644 --- a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/MailSessionFactory.java +++ b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/MailSessionFactory.java @@ -2,8 +2,8 @@ import com.kumuluz.ee.common.config.MailServiceConfig; import com.kumuluz.ee.common.config.MailSessionConfig; +import jakarta.mail.Session; -import javax.mail.Session; import java.util.Map; import java.util.Properties; import java.util.logging.Logger; diff --git a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/ManagedPasswordAuthenticator.java b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/ManagedPasswordAuthenticator.java index 6bbffc0a..3b3305a5 100644 --- a/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/ManagedPasswordAuthenticator.java +++ b/components/javamail/ri/src/main/java/com/kumuluz/ee/javamail/ri/ManagedPasswordAuthenticator.java @@ -2,9 +2,8 @@ import com.kumuluz.ee.common.config.MailServiceConfig; import com.kumuluz.ee.common.config.MailSessionConfig; - -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; +import jakarta.mail.Authenticator; +import jakarta.mail.PasswordAuthentication; public class ManagedPasswordAuthenticator extends Authenticator { diff --git a/components/jax-rs/jersey/pom.xml b/components/jax-rs/jersey/pom.xml index 75ba75f9..3dffe751 100644 --- a/components/jax-rs/jersey/pom.xml +++ b/components/jax-rs/jersey/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jax-rs com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -27,7 +27,11 @@ org.glassfish.hk2.external - javax.inject + jakarta.inject + + + org.eclipse.jetty + jetty-util @@ -38,7 +42,7 @@ org.glassfish.hk2.external - javax.inject + jakarta.inject @@ -54,7 +58,7 @@ org.glassfish.hk2.external - javax.inject + jakarta.inject org.javassist @@ -77,8 +81,8 @@ - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider @@ -86,6 +90,10 @@ jersey-jetty-connector ${jersey.version} + + org.eclipse.jetty + jetty-util + org.eclipse.jetty jetty-client @@ -99,8 +107,8 @@ jersey-client - javax.ws.rs - javax.ws.rs-api + jakarta.ws.rs + jakarta.ws.rs-api @@ -112,14 +120,20 @@ - javax.activation - activation + jakarta.activation + jakarta.activation-api ${activation.version} - javax.xml.bind - jaxb-api - ${jaxb-api.version} + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta-xml-bind-api.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb-impl.version} + runtime diff --git a/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/JaxRsComponent.java b/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/JaxRsComponent.java index 80b3a385..d53b5f12 100644 --- a/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/JaxRsComponent.java +++ b/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/JaxRsComponent.java @@ -37,7 +37,7 @@ @EeComponentDependency(value = EeComponentType.SERVLET) public class JaxRsComponent implements Component { - private Logger log = Logger.getLogger(JaxRsComponent.class.getSimpleName()); + private final Logger log = Logger.getLogger(JaxRsComponent.class.getSimpleName()); @Override public void init(KumuluzServerWrapper server, EeConfig eeConfig) { @@ -45,7 +45,6 @@ public void init(KumuluzServerWrapper server, EeConfig eeConfig) { @Override public void load() { - log.info("Initiating Jersey"); } } diff --git a/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/Jetty10ConnectorProvider.java b/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/Jetty10ConnectorProvider.java index 92e955f2..b796cc46 100644 --- a/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/Jetty10ConnectorProvider.java +++ b/components/jax-rs/jersey/src/main/java/com/kumuluz/ee/jaxrs/Jetty10ConnectorProvider.java @@ -20,13 +20,12 @@ */ package com.kumuluz.ee.jaxrs; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Configuration; import org.glassfish.jersey.client.spi.Connector; import org.glassfish.jersey.client.spi.ConnectorProvider; import org.glassfish.jersey.jetty.connector.Jetty10Connector; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Configuration; - /** * Jersey connection provider for Jetty 10. * diff --git a/components/jax-rs/jersey/src/main/java/org/glassfish/jersey/jetty/connector/Jetty10Connector.java b/components/jax-rs/jersey/src/main/java/org/glassfish/jersey/jetty/connector/Jetty10Connector.java index e3b03dc2..5303ddd6 100644 --- a/components/jax-rs/jersey/src/main/java/org/glassfish/jersey/jetty/connector/Jetty10Connector.java +++ b/components/jax-rs/jersey/src/main/java/org/glassfish/jersey/jetty/connector/Jetty10Connector.java @@ -16,12 +16,40 @@ package org.glassfish.jersey.jetty.connector; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import jakarta.ws.rs.ProcessingException; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Configuration; +import jakarta.ws.rs.core.MultivaluedMap; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.HttpProxy; +import org.eclipse.jetty.client.ProxyConfiguration; +import org.eclipse.jetty.client.api.*; +import org.eclipse.jetty.client.dynamic.HttpClientTransportDynamic; +import org.eclipse.jetty.client.util.BasicAuthentication; +import org.eclipse.jetty.client.util.BytesRequestContent; +import org.eclipse.jetty.client.util.FutureResponseListener; +import org.eclipse.jetty.client.util.OutputStreamRequestContent; +import org.eclipse.jetty.http.HttpField; +import org.eclipse.jetty.http.HttpFields; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.io.ClientConnector; +import org.eclipse.jetty.util.HttpCookieStore; +import org.eclipse.jetty.util.Jetty; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.ClientRequest; +import org.glassfish.jersey.client.ClientResponse; +import org.glassfish.jersey.client.internal.LocalizationMessages; +import org.glassfish.jersey.client.spi.AsyncConnectorCallback; +import org.glassfish.jersey.client.spi.Connector; +import org.glassfish.jersey.internal.util.collection.ByteBufferInputStream; +import org.glassfish.jersey.internal.util.collection.NonBlockingInputStream; +import org.glassfish.jersey.message.internal.HeaderUtils; +import org.glassfish.jersey.message.internal.Statuses; + +import javax.net.ssl.SSLContext; +import java.io.*; import java.net.CookieStore; import java.net.URI; import java.nio.ByteBuffer; @@ -38,47 +66,6 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.ws.rs.ProcessingException; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Configuration; -import javax.ws.rs.core.MultivaluedMap; - -import javax.net.ssl.SSLContext; - -import org.eclipse.jetty.client.dynamic.HttpClientTransportDynamic; -import org.eclipse.jetty.client.util.BasicAuthentication; -import org.eclipse.jetty.client.util.BytesContentProvider; -import org.eclipse.jetty.client.util.FutureResponseListener; -import org.eclipse.jetty.client.util.OutputStreamContentProvider; -import org.eclipse.jetty.io.ClientConnector; -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.client.ClientRequest; -import org.glassfish.jersey.client.ClientResponse; -import org.glassfish.jersey.client.spi.AsyncConnectorCallback; -import org.glassfish.jersey.client.spi.Connector; -import org.glassfish.jersey.internal.util.collection.ByteBufferInputStream; -import org.glassfish.jersey.internal.util.collection.NonBlockingInputStream; -import org.glassfish.jersey.message.internal.HeaderUtils; -import org.glassfish.jersey.message.internal.OutboundMessageContext; -import org.glassfish.jersey.message.internal.Statuses; - -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.HttpProxy; -import org.eclipse.jetty.client.ProxyConfiguration; -import org.eclipse.jetty.client.api.AuthenticationStore; -import org.eclipse.jetty.client.api.ContentProvider; -import org.eclipse.jetty.client.api.ContentResponse; -import org.eclipse.jetty.client.api.Request; -import org.eclipse.jetty.client.api.Response; -import org.eclipse.jetty.client.api.Result; -import org.eclipse.jetty.http.HttpField; -import org.eclipse.jetty.http.HttpFields; -import org.eclipse.jetty.http.HttpHeader; -import org.eclipse.jetty.util.HttpCookieStore; -import org.eclipse.jetty.util.Jetty; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.util.thread.QueuedThreadPool; - /** * A {@link Connector} that utilizes the Jetty HTTP Client to send and receive * HTTP request and responses. @@ -122,7 +109,7 @@ * This connector supports only {@link org.glassfish.jersey.client.RequestEntityProcessing#BUFFERED entity buffering}. * Defining the property {@link ClientProperties#REQUEST_ENTITY_PROCESSING} has no effect on this connector. *

- * + *

* Adapted from org.glassfish.jersey.jetty.connector.JettyConnector for Jetty 10: * - updated SSL context initialization * - updated header handling @@ -143,14 +130,14 @@ public class Jetty10Connector implements Connector { * Create the new Jetty client connector. * * @param jaxrsClient JAX-RS client instance, for which the connector is created. - * @param config client configuration. + * @param config client configuration. */ public Jetty10Connector(final Client jaxrsClient, final Configuration config) { this.configuration = config; HttpClient httpClient = null; if (config.isRegistered(JettyHttpClientSupplier.class)) { Optional contract = config.getInstances().stream() - .filter(a-> JettyHttpClientSupplier.class.isInstance(a)).findFirst(); + .filter(JettyHttpClientSupplier.class::isInstance).findFirst(); if (contract.isPresent()) { httpClient = ((JettyHttpClientSupplier) contract.get()).getHttpClient(); } @@ -174,23 +161,23 @@ public Jetty10Connector(final Client jaxrsClient, final Configuration config) { } final Object connectTimeout = config.getProperties().get(ClientProperties.CONNECT_TIMEOUT); - if (connectTimeout != null && connectTimeout instanceof Integer && (Integer) connectTimeout > 0) { - client.setConnectTimeout((Integer) connectTimeout); + if (connectTimeout instanceof Integer cTimeout && cTimeout > 0) { + client.setConnectTimeout(cTimeout); } final Object threadPoolSize = config.getProperties().get(ClientProperties.ASYNC_THREADPOOL_SIZE); - if (threadPoolSize != null && threadPoolSize instanceof Integer && (Integer) threadPoolSize > 0) { + if (threadPoolSize instanceof Integer tPoolSize && tPoolSize > 0) { final String name = HttpClient.class.getSimpleName() + "@" + hashCode(); - final QueuedThreadPool threadPool = new QueuedThreadPool((Integer) threadPoolSize); + final QueuedThreadPool threadPool = new QueuedThreadPool(tPoolSize); threadPool.setName(name); client.setExecutor(threadPool); } Boolean disableCookies = (Boolean) config.getProperties().get(JettyClientProperties.DISABLE_COOKIES); - disableCookies = (disableCookies != null) ? disableCookies : false; + disableCookies = (disableCookies != null) && disableCookies; final AuthenticationStore auth = client.getAuthenticationStore(); final Object basicAuthProvider = config.getProperty(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION); - if (basicAuthProvider != null && (basicAuthProvider instanceof BasicAuthentication)) { - auth.addAuthentication((BasicAuthentication) basicAuthProvider); + if (basicAuthProvider instanceof BasicAuthentication baseAuth) { + auth.addAuthentication(baseAuth); } final Object proxyUri = config.getProperties().get(ClientProperties.PROXY_URI); @@ -213,11 +200,10 @@ public Jetty10Connector(final Client jaxrsClient, final Configuration config) { final Object slResponseMaxSize = configuration.getProperties() .get(JettyClientProperties.SYNC_LISTENER_RESPONSE_MAX_SIZE); - if (slResponseMaxSize != null && slResponseMaxSize instanceof Integer - && (Integer) slResponseMaxSize > 0) { - this.syncListenerResponseMaxSize = Optional.of((Integer) slResponseMaxSize); - } - else { + if (slResponseMaxSize instanceof Integer slResponseMaxSizeC + && slResponseMaxSizeC > 0) { + this.syncListenerResponseMaxSize = Optional.of(slResponseMaxSizeC); + } else { this.syncListenerResponseMaxSize = Optional.empty(); } @@ -231,10 +217,10 @@ public Jetty10Connector(final Client jaxrsClient, final Configuration config) { @SuppressWarnings("ChainOfInstanceofChecks") private static URI getProxyUri(final Object proxy) { - if (proxy instanceof URI) { - return (URI) proxy; - } else if (proxy instanceof String) { - return URI.create((String) proxy); + if (proxy instanceof URI uriProxy) { + return uriProxy; + } else if (proxy instanceof String stringProxy) { + return URI.create(stringProxy); } else { throw new ProcessingException(LocalizationMessages.WRONG_PROXY_URI_TYPE(ClientProperties.PROXY_URI)); } @@ -264,17 +250,16 @@ public CookieStore getCookieStore() { public ClientResponse apply(final ClientRequest jerseyRequest) throws ProcessingException { final Request jettyRequest = translateRequest(jerseyRequest); final Map clientHeadersSnapshot = writeOutBoundHeaders(jerseyRequest.getHeaders(), jettyRequest); - final ContentProvider entity = getBytesProvider(jerseyRequest); + final Request.Content entity = getBytesProvider(jerseyRequest); if (entity != null) { - jettyRequest.content(entity); + jettyRequest.body(entity); } try { final ContentResponse jettyResponse; if (!syncListenerResponseMaxSize.isPresent()) { jettyResponse = jettyRequest.send(); - } - else { + } else { final FutureResponseListener listener = new FutureResponseListener(jettyRequest, syncListenerResponseMaxSize.get()); jettyRequest.send(listener); @@ -283,7 +268,7 @@ public ClientResponse apply(final ClientRequest jerseyRequest) throws Processing HeaderUtils.checkHeaderChanges(clientHeadersSnapshot, jerseyRequest.getHeaders(), Jetty10Connector.this.getClass().getName(), jerseyRequest.getConfiguration()); - final javax.ws.rs.core.Response.StatusType status = jettyResponse.getReason() == null + final jakarta.ws.rs.core.Response.StatusType status = jettyResponse.getReason() == null ? Statuses.from(jettyResponse.getStatus()) : Statuses.from(jettyResponse.getStatus(), jettyResponse.getReason()); @@ -333,8 +318,8 @@ private Request translateRequest(final ClientRequest clientRequest) { request.followRedirects(clientRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true)); final Object readTimeout = clientRequest.resolveProperty(ClientProperties.READ_TIMEOUT, -1); - if (readTimeout != null && readTimeout instanceof Integer && (Integer) readTimeout > 0) { - request.timeout((Integer) readTimeout, TimeUnit.MILLISECONDS); + if (readTimeout instanceof Integer rTimeout && rTimeout > 0) { + request.timeout(rTimeout, TimeUnit.MILLISECONDS); } return request; } @@ -354,7 +339,7 @@ private Map writeOutBoundHeaders(final MultivaluedMap outputStream); try { clientRequest.writeEntity(); } catch (final IOException e) { throw new ProcessingException("Failed to write request entity.", e); } - return new BytesContentProvider(outputStream.toByteArray()); + return new BytesRequestContent(outputStream.toByteArray()); } - private ContentProvider getStreamProvider(final ClientRequest clientRequest) { + private Request.Content getStreamProvider(final ClientRequest clientRequest) { final Object entity = clientRequest.getEntity(); if (entity == null) { return null; } - final OutputStreamContentProvider streamContentProvider = new OutputStreamContentProvider(); - clientRequest.setStreamProvider(new OutboundMessageContext.StreamProvider() { - @Override - public OutputStream getOutputStream(final int contentLength) throws IOException { - return streamContentProvider.getOutputStream(); - } - }); + final OutputStreamRequestContent streamContentProvider = new OutputStreamRequestContent(); + clientRequest.setStreamProvider(contentLength -> streamContentProvider.getOutputStream()); return streamContentProvider; } - private void processContent(final ClientRequest clientRequest, final ContentProvider entity) throws IOException { + private void processContent(final ClientRequest clientRequest, final Request.Content entity) throws IOException { if (entity == null) { return; } - final OutputStreamContentProvider streamContentProvider = (OutputStreamContentProvider) entity; - try (final OutputStream output = streamContentProvider.getOutputStream()) { + final OutputStreamRequestContent streamContentProvider = (OutputStreamRequestContent) entity; + try (final OutputStream ignored = streamContentProvider.getOutputStream()) { clientRequest.writeEntity(); } } @@ -409,9 +384,9 @@ private void processContent(final ClientRequest clientRequest, final ContentProv public Future apply(final ClientRequest jerseyRequest, final AsyncConnectorCallback callback) { final Request jettyRequest = translateRequest(jerseyRequest); final Map clientHeadersSnapshot = writeOutBoundHeaders(jerseyRequest.getHeaders(), jettyRequest); - final ContentProvider entity = getStreamProvider(jerseyRequest); + final Request.Content entity = getStreamProvider(jerseyRequest); if (entity != null) { - jettyRequest.content(entity); + jettyRequest.body(entity); } final AtomicBoolean callbackInvoked = new AtomicBoolean(false); final Throwable failure; @@ -419,26 +394,25 @@ public Future apply(final ClientRequest jerseyRequest, final AsyncConnectorCa final CompletableFuture responseFuture = new CompletableFuture().whenComplete( (clientResponse, throwable) -> { - if (throwable != null && throwable instanceof CancellationException) { + if (throwable instanceof CancellationException throwable1) { // take care of future cancellation - jettyRequest.abort(throwable); + jettyRequest.abort(throwable1); } }); final AtomicReference jerseyResponse = new AtomicReference<>(); final ByteBufferInputStream entityStream = new ByteBufferInputStream(); - jettyRequest.send(new Response.Listener.Adapter() { + jettyRequest.send(new Response.Listener() { @Override public void onHeaders(final Response jettyResponse) { HeaderUtils.checkHeaderChanges(clientHeadersSnapshot, jerseyRequest.getHeaders(), Jetty10Connector.this.getClass().getName(), jerseyRequest.getConfiguration()); - if (responseFuture.isDone()) { - if (!callbackInvoked.compareAndSet(false, true)) { - return; - } + if (responseFuture.isDone() + && (!callbackInvoked.compareAndSet(false, true))) { + return; } final ClientResponse response = translateResponse(jerseyRequest, jettyResponse, entityStream); jerseyResponse.set(response); @@ -489,7 +463,7 @@ public void onFailure(final Response response, final Throwable t) { }); processContent(jerseyRequest, entity); return responseFuture; - } catch (final Throwable t) { + } catch (final Exception t) { failure = t; } @@ -502,7 +476,7 @@ public void onFailure(final Response response, final Throwable t) { } private static ClientResponse translateResponse(final ClientRequest jerseyRequest, - final org.eclipse.jetty.client.api.Response jettyResponse, + final Response jettyResponse, final NonBlockingInputStream entityStream) { final ClientResponse jerseyResponse = new ClientResponse(Statuses.from(jettyResponse.getStatus()), jerseyRequest); processResponseHeaders(jettyResponse.getHeaders(), jerseyResponse); diff --git a/components/jax-rs/pom.xml b/components/jax-rs/pom.xml index 0ee7c5b7..d8200538 100644 --- a/components/jax-rs/pom.xml +++ b/components/jax-rs/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/jax-ws/cxf/pom.xml b/components/jax-ws/cxf/pom.xml index a14bd7e7..f93f1f59 100644 --- a/components/jax-ws/cxf/pom.xml +++ b/components/jax-ws/cxf/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jax-ws com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -46,14 +46,14 @@ ${jaxws-tools.version} - javax.activation - activation + jakarta.activation + jakarta.activation-api ${activation.version} - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/KumuluzCXFServlet.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/KumuluzCXFServlet.java index b6e3ff81..10c5607d 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/KumuluzCXFServlet.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/KumuluzCXFServlet.java @@ -23,10 +23,10 @@ import com.kumuluz.ee.jaxws.cxf.processor.JaxWsAnnotationProcessorUtil; import com.kumuluz.ee.jaxws.cxf.ws.CXFWebservicePublisher; import com.kumuluz.ee.jaxws.cxf.ws.Endpoint; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; import org.apache.cxf.transport.servlet.CXFNonSpringServlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; import java.util.List; /** diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessor.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessor.java index 011c9ef2..d9b9313c 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessor.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessor.java @@ -20,11 +20,12 @@ */ package com.kumuluz.ee.jaxws.cxf.processor; +import jakarta.jws.WebService; + import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; import javax.annotation.processing.ProcessingEnvironment; import javax.annotation.processing.RoundEnvironment; -import javax.jws.WebService; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtil.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtil.java index 5f5d868c..89cd895b 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtil.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtil.java @@ -22,8 +22,8 @@ import com.kumuluz.ee.jaxws.cxf.annotations.WsContext; import com.kumuluz.ee.jaxws.cxf.ws.Endpoint; +import jakarta.jws.WebService; -import javax.jws.WebService; import java.io.InputStream; import java.util.ArrayList; import java.util.LinkedList; diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/CXFWebservicePublisher.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/CXFWebservicePublisher.java index 179e56f9..1b100927 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/CXFWebservicePublisher.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/CXFWebservicePublisher.java @@ -20,19 +20,19 @@ */ package com.kumuluz.ee.jaxws.cxf.ws; +import jakarta.annotation.Resource; +import jakarta.enterprise.inject.spi.CDI; +import jakarta.xml.ws.WebServiceContext; import org.apache.cxf.Bus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxws.JaxWsServerFactoryBean; import org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder; import org.apache.cxf.service.invoker.Invoker; -import javax.annotation.Resource; -import javax.enterprise.inject.spi.CDI; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NameAlreadyBoundException; import javax.naming.NamingException; -import javax.xml.ws.WebServiceContext; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.logging.Logger; @@ -131,7 +131,8 @@ private Object getBean(Class clazz, boolean cdiPresent) { //pojo instance try { return clazz.getConstructor().newInstance(); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + } catch (InstantiationException | IllegalAccessException | InvocationTargetException | + NoSuchMethodException e) { throw new RuntimeException("Unable to instantiate bean from " + clazz, e); } diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/Endpoint.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/Endpoint.java index 24b3d633..cd54a846 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/Endpoint.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/Endpoint.java @@ -20,7 +20,7 @@ */ package com.kumuluz.ee.jaxws.cxf.ws; -import javax.jws.WebService; +import jakarta.jws.WebService; /** * @author gpor89 diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/InjectionHelper.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/InjectionHelper.java index e6fb2908..7bb37956 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/InjectionHelper.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/InjectionHelper.java @@ -20,8 +20,9 @@ */ package com.kumuluz.ee.jaxws.cxf.ws; -import javax.annotation.Resource; -import javax.xml.ws.WebServiceContext; +import jakarta.annotation.Resource; +import jakarta.xml.ws.WebServiceContext; + import java.lang.reflect.Field; /** diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWSInvoker.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWSInvoker.java index 618fdc43..4b2315ca 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWSInvoker.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWSInvoker.java @@ -20,6 +20,7 @@ */ package com.kumuluz.ee.jaxws.cxf.ws; +import jakarta.xml.ws.WebServiceContext; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.jaxws.JAXWSMethodInvoker; import org.apache.cxf.jaxws.context.WebServiceContextImpl; @@ -31,7 +32,6 @@ import org.apache.cxf.service.invoker.MethodDispatcher; import org.apache.cxf.service.model.BindingOperationInfo; -import javax.xml.ws.WebServiceContext; import java.lang.reflect.Method; import java.util.List; diff --git a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContext.java b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContext.java index eaae7fd1..131be93d 100755 --- a/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContext.java +++ b/components/jax-ws/cxf/src/main/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContext.java @@ -22,9 +22,9 @@ import org.w3c.dom.Element; -import javax.xml.ws.EndpointReference; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.handler.MessageContext; +import jakarta.xml.ws.EndpointReference; +import jakarta.xml.ws.WebServiceContext; +import jakarta.xml.ws.handler.MessageContext; import java.io.Serializable; import java.security.Principal; diff --git a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/NoWsContextAnnotatedEndpointBean.java b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/NoWsContextAnnotatedEndpointBean.java index d94bb1a6..54b3b85b 100755 --- a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/NoWsContextAnnotatedEndpointBean.java +++ b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/NoWsContextAnnotatedEndpointBean.java @@ -1,6 +1,6 @@ package com.kumuluz.ee.jaxws.cxf.impl; -import javax.jws.WebService; +import jakarta.jws.WebService; @WebService public class NoWsContextAnnotatedEndpointBean { diff --git a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WebServiceContextBean.java b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WebServiceContextBean.java index ec50cc82..9d6c4d40 100755 --- a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WebServiceContextBean.java +++ b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WebServiceContextBean.java @@ -1,15 +1,14 @@ package com.kumuluz.ee.jaxws.cxf.impl; +import jakarta.xml.ws.EndpointReference; +import jakarta.xml.ws.WebServiceContext; +import jakarta.xml.ws.handler.MessageContext; import org.apache.cxf.jaxws.handler.logical.LogicalMessageContextImpl; import org.apache.cxf.message.MessageImpl; import org.w3c.dom.Element; -import javax.xml.ws.EndpointReference; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.handler.MessageContext; import java.security.Principal; - public class WebServiceContextBean implements WebServiceContext { MessageContext messageContext; diff --git a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WsContextAnnotatedEndpointBean.java b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WsContextAnnotatedEndpointBean.java index dc5e2dc7..8f2fbc44 100755 --- a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WsContextAnnotatedEndpointBean.java +++ b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/impl/WsContextAnnotatedEndpointBean.java @@ -1,8 +1,7 @@ package com.kumuluz.ee.jaxws.cxf.impl; import com.kumuluz.ee.jaxws.cxf.annotations.WsContext; - -import javax.jws.WebService; +import jakarta.jws.WebService; @WsContext(contextRoot = WsContextAnnotatedEndpointBean.CTX_ROOT, urlPattern = WsContextAnnotatedEndpointBean.URL_PATTERN) @WebService(wsdlLocation = WsContextAnnotatedEndpointBean.WSDL_URL, portName = WsContextAnnotatedEndpointBean.PORT, serviceName = diff --git a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtilTest.java b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtilTest.java index cd83896d..42373982 100755 --- a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtilTest.java +++ b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/processor/JaxWsAnnotationProcessorUtilTest.java @@ -2,23 +2,23 @@ import com.kumuluz.ee.jaxws.cxf.impl.NoWsContextAnnotatedEndpointBean; import com.kumuluz.ee.jaxws.cxf.impl.WsContextAnnotatedEndpointBean; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.net.URL; import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.stream.Stream; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; -public class JaxWsAnnotationProcessorUtilTest { +class JaxWsAnnotationProcessorUtilTest { - private JaxWsAnnotationProcessorUtil instance = JaxWsAnnotationProcessorUtil.getInstance(); + private final JaxWsAnnotationProcessorUtil instance = JaxWsAnnotationProcessorUtil.getInstance(); @Test - public void shouldReturnDefaultWsInfo() { + void shouldReturnDefaultWsInfo() { String className = NoWsContextAnnotatedEndpointBean.class.getName(); Class clazz = NoWsContextAnnotatedEndpointBean.class; @@ -30,22 +30,27 @@ public void shouldReturnDefaultWsInfo() { String expectedUrl = "/" + className; //check implementation class - assertEquals("Ws endpoint returned wrong implementation value", clazz, instance.getEndpointList().get(0).getImplementationClass()); + assertEquals(clazz, instance.getEndpointList().get(0).getImplementationClass(), + "Ws endpoint returned wrong implementation value"); //assert @WsContext - assertEquals("Ws endpoint without defined contextRoot returned wrong value", expectedContextRoot, instance.getContextRoot()); + assertEquals(expectedContextRoot, instance.getContextRoot(), + "Ws endpoint without defined contextRoot returned wrong value"); assertFalse(instance.getEndpointList().isEmpty()); - assertEquals("Ws endpoint without defined url returned wrong value", expectedUrl, instance.getEndpointList().get(0).getUrl()); + assertEquals(expectedUrl, instance.getEndpointList().get(0).getUrl(), + "Ws endpoint without defined url returned wrong value"); //assert @Webservice - assertNull("Ws endpoint without defined wsdlLocation returned wrong value", instance.getEndpointList().get(0).wsdlLocation()); - assertNull("Ws endpoint without defined wsdlLocation returned wrong value", instance.getEndpointList().get(0).portName()); - assertNull("Ws endpoint without defined wsdlLocation returned wrong value", instance.getEndpointList().get(0).serviceName()); - + assertNull(instance.getEndpointList().get(0).wsdlLocation(), + "Ws endpoint without defined wsdlLocation returned wrong value"); + assertNull(instance.getEndpointList().get(0).portName(), + "Ws endpoint without defined wsdlLocation returned wrong value"); + assertNull(instance.getEndpointList().get(0).serviceName(), + "Ws endpoint without defined wsdlLocation returned wrong value"); } @Test - public void shouldReturnConfiguredWsInfo() { + void shouldReturnConfiguredWsInfo() { String className = WsContextAnnotatedEndpointBean.class.getName(); Class clazz = WsContextAnnotatedEndpointBean.class; @@ -55,21 +60,23 @@ public void shouldReturnConfiguredWsInfo() { //check implementation class - assertEquals("Ws endpoint returned wrong implementation value", clazz, instance.getEndpointList().get(0).getImplementationClass()); + assertEquals(clazz, instance.getEndpointList().get(0).getImplementationClass(), + "Ws endpoint returned wrong implementation value"); //assert @WsContext - assertEquals("Ws endpoint without defined contextRoot returned wrong value", WsContextAnnotatedEndpointBean.CTX_ROOT, instance.getContextRoot()); + assertEquals(WsContextAnnotatedEndpointBean.CTX_ROOT, instance.getContextRoot(), + "Ws endpoint without defined contextRoot returned wrong value"); assertFalse(instance.getEndpointList().isEmpty()); - assertEquals("Ws endpoint without defined url returned wrong value", WsContextAnnotatedEndpointBean.URL_PATTERN, instance.getEndpointList().get(0) - .getUrl()); + assertEquals(WsContextAnnotatedEndpointBean.URL_PATTERN, instance.getEndpointList().get(0).getUrl(), + "Ws endpoint without defined url returned wrong value"); //assert @Webservice - assertEquals("Ws endpoint without defined wsdlLocation returned wrong value", WsContextAnnotatedEndpointBean.WSDL_URL, instance.getEndpointList() - .get(0).wsdlLocation()); - assertEquals("Ws endpoint without defined wsdlLocation returned wrong value", WsContextAnnotatedEndpointBean.PORT, instance.getEndpointList() - .get(0).portName()); - assertEquals("Ws endpoint without defined wsdlLocation returned wrong value", WsContextAnnotatedEndpointBean.SERVICE, instance.getEndpointList() - .get(0).serviceName()); + assertEquals(WsContextAnnotatedEndpointBean.WSDL_URL, instance.getEndpointList().get(0).wsdlLocation(), + "Ws endpoint without defined wsdlLocation returned wrong value"); + assertEquals(WsContextAnnotatedEndpointBean.PORT, instance.getEndpointList().get(0).portName(), + "Ws endpoint without defined wsdlLocation returned wrong value"); + assertEquals(WsContextAnnotatedEndpointBean.SERVICE, instance.getEndpointList().get(0).serviceName(), + "Ws endpoint without defined wsdlLocation returned wrong value"); } //helper method @@ -80,7 +87,7 @@ private void prepareEndpointList(String... endpoints) { throw new RuntimeException("Service file not found."); } - try (PrintWriter out = new PrintWriter(new File(URLDecoder.decode(url.getFile(), "UTF-8")))) { + try (PrintWriter out = new PrintWriter(URLDecoder.decode(url.getFile(), StandardCharsets.UTF_8))) { Stream.of(endpoints).forEach(out::print); out.flush(); } catch (IOException fe) { diff --git a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContextTest.java b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContextTest.java index 183cf2d6..fc2bbd06 100755 --- a/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContextTest.java +++ b/components/jax-ws/cxf/src/test/java/com/kumuluz/ee/jaxws/cxf/ws/KumuluzWebServiceContextTest.java @@ -1,9 +1,10 @@ package com.kumuluz.ee.jaxws.cxf.ws; import com.kumuluz.ee.jaxws.cxf.impl.WebServiceContextBean; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.Assert.assertTrue; public class KumuluzWebServiceContextTest { @@ -18,8 +19,8 @@ public void shouldUseRightContext() throws InterruptedException { one.join(); two.join(); - assertTrue("Thread 1 context not properly propagated", one.isSuccessful()); - assertTrue("Thread 2 context not properly propagated", two.isSuccessful()); + assertTrue(one.isSuccessful(), "Thread 1 context not properly propagated"); + assertTrue(two.isSuccessful(), "Thread 2 context not properly propagated"); } public static class WsThread extends Thread { @@ -41,6 +42,4 @@ public boolean isSuccessful() { return successful; } } - - } diff --git a/components/jax-ws/metro/pom.xml b/components/jax-ws/metro/pom.xml index 3608c563..6b509591 100644 --- a/components/jax-ws/metro/pom.xml +++ b/components/jax-ws/metro/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jax-ws com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -32,8 +32,8 @@ - javax.activation - activation + jakarta.activation + jakarta.activation-api ${activation.version} diff --git a/components/jax-ws/pom.xml b/components/jax-ws/pom.xml index 70b575e8..5a63052e 100644 --- a/components/jax-ws/pom.xml +++ b/components/jax-ws/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/jpa/common/pom.xml b/components/jpa/common/pom.xml index 70f5f12e..9d084b17 100644 --- a/components/jpa/common/pom.xml +++ b/components/jpa/common/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jpa com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceUnitHolder.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceUnitHolder.java index a3019b6f..cf9b1721 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceUnitHolder.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceUnitHolder.java @@ -21,9 +21,9 @@ package com.kumuluz.ee.jpa.common; import com.kumuluz.ee.jpa.common.utils.PersistenceUtils; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.Persistence; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; import java.util.HashMap; import java.util.Map; import java.util.Properties; diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceWrapper.java index 307d8c50..08ed4118 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/PersistenceWrapper.java @@ -20,7 +20,8 @@ */ package com.kumuluz.ee.jpa.common; -import javax.persistence.EntityManagerFactory; + +import jakarta.persistence.EntityManagerFactory; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/EntityManagerWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/EntityManagerWrapper.java index 659c76a8..8fb51507 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/EntityManagerWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/EntityManagerWrapper.java @@ -17,10 +17,10 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.injection; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/JpaService.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/JpaService.java index df0b0bf3..c5a36c45 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/JpaService.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/JpaService.java @@ -24,15 +24,15 @@ import com.kumuluz.ee.jpa.common.PersistenceUnitHolder; import com.kumuluz.ee.jpa.common.PersistenceWrapper; import com.kumuluz.ee.jpa.common.exceptions.NoDefaultPersistenceUnit; +import jakarta.annotation.Priority; +import jakarta.enterprise.inject.spi.InjectionPoint; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.PersistenceUnit; import org.jboss.weld.injection.spi.JpaInjectionServices; import org.jboss.weld.injection.spi.ResourceReferenceFactory; -import javax.annotation.Priority; -import javax.enterprise.inject.spi.InjectionPoint; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceContext; -import javax.persistence.PersistenceUnit; import java.util.Optional; import java.util.logging.Logger; diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/NonTxEntityManagerWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/NonTxEntityManagerWrapper.java index a9167dc3..74773556 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/NonTxEntityManagerWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/NonTxEntityManagerWrapper.java @@ -1,6 +1,7 @@ package com.kumuluz.ee.jpa.common.injection; -import javax.persistence.EntityManager; + +import jakarta.persistence.EntityManager; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResource.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResource.java index 0c9eeaf9..57b15d98 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResource.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResource.java @@ -17,12 +17,12 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.injection; +import jakarta.persistence.EntityManager; import org.jboss.weld.injection.spi.ResourceReference; -import javax.persistence.EntityManager; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResourceFactory.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResourceFactory.java index 06f604cf..b8d61e33 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResourceFactory.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceContextResourceFactory.java @@ -22,13 +22,12 @@ import com.kumuluz.ee.jpa.common.TransactionType; import com.kumuluz.ee.jpa.common.jta.TxScopedEntityManagerFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.SynchronizationType; import org.jboss.weld.injection.spi.ResourceReference; import org.jboss.weld.injection.spi.ResourceReferenceFactory; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.SynchronizationType; - /** * @author Tilen Faganel * @since 1.0.0 diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResource.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResource.java index 809f47c8..d3a3308a 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResource.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResource.java @@ -17,13 +17,12 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.injection; +import jakarta.persistence.EntityManagerFactory; import org.jboss.weld.injection.spi.ResourceReference; -import javax.persistence.EntityManagerFactory; - /** * @author Tilen Faganel * @since 1.0.0 diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResourceFactory.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResourceFactory.java index c813d832..6388b684 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResourceFactory.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/injection/PersistenceUnitResourceFactory.java @@ -17,14 +17,13 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.injection; +import jakarta.persistence.EntityManagerFactory; import org.jboss.weld.injection.spi.ResourceReference; import org.jboss.weld.injection.spi.ResourceReferenceFactory; -import javax.persistence.EntityManagerFactory; - /** * @author Tilen Faganel * @since 1.0.0 diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxEntityManagerHolder.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxEntityManagerHolder.java index 9b455860..e4249d05 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxEntityManagerHolder.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxEntityManagerHolder.java @@ -20,7 +20,8 @@ */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.EntityManager; + +import jakarta.persistence.EntityManager; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxQueryWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxQueryWrapper.java index 14afe7e1..5e2267d2 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxQueryWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxQueryWrapper.java @@ -20,7 +20,8 @@ */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.*; +import jakarta.persistence.*; + import java.util.*; /** diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxStoredProcedureQueryWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxStoredProcedureQueryWrapper.java index 89eb36be..5ce97e23 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxStoredProcedureQueryWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxStoredProcedureQueryWrapper.java @@ -17,10 +17,11 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.*; +import jakarta.persistence.*; + import java.util.*; /** diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxTypedQueryWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxTypedQueryWrapper.java index dccfbc24..a0608709 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxTypedQueryWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/NonTxTypedQueryWrapper.java @@ -17,10 +17,11 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.*; +import jakarta.persistence.*; + import java.util.*; /** diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/SyncEntityManagerWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/SyncEntityManagerWrapper.java index bf82d13a..a59520aa 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/SyncEntityManagerWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/SyncEntityManagerWrapper.java @@ -20,12 +20,13 @@ */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.*; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaDelete; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.CriteriaUpdate; -import javax.persistence.metamodel.Metamodel; +import jakarta.persistence.*; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaDelete; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.CriteriaUpdate; +import jakarta.persistence.metamodel.Metamodel; + import java.util.List; import java.util.Map; diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManager.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManager.java index 567b12d9..f555fa55 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManager.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManager.java @@ -17,19 +17,19 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.jta; import com.kumuluz.ee.jta.common.utils.TxUtils; +import jakarta.persistence.*; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaDelete; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.CriteriaUpdate; +import jakarta.persistence.metamodel.Metamodel; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.TransactionSynchronizationRegistry; -import javax.persistence.*; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaDelete; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.CriteriaUpdate; -import javax.persistence.metamodel.Metamodel; -import javax.transaction.TransactionManager; -import javax.transaction.TransactionSynchronizationRegistry; import java.util.List; import java.util.Map; diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerFactory.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerFactory.java index 067f21fd..1fe2ff5b 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerFactory.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerFactory.java @@ -17,17 +17,17 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.jta; import com.kumuluz.ee.jpa.common.injection.EntityManagerWrapper; import com.kumuluz.ee.jta.common.JtaProvider; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.SynchronizationType; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.TransactionSynchronizationRegistry; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.SynchronizationType; -import javax.transaction.TransactionManager; -import javax.transaction.TransactionSynchronizationRegistry; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerWrapper.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerWrapper.java index 6b94ada5..dd5b1021 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerWrapper.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxScopedEntityManagerWrapper.java @@ -17,13 +17,12 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.common.jta; import com.kumuluz.ee.jpa.common.injection.EntityManagerWrapper; -import com.kumuluz.ee.jpa.common.jta.NonTxEntityManagerHolder; +import jakarta.persistence.EntityManager; -import javax.persistence.EntityManager; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxSynchronization.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxSynchronization.java index 44935869..224819fa 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxSynchronization.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/jta/TxSynchronization.java @@ -20,8 +20,9 @@ */ package com.kumuluz.ee.jpa.common.jta; -import javax.persistence.EntityManager; -import javax.transaction.Synchronization; + +import jakarta.persistence.EntityManager; +import jakarta.transaction.Synchronization; /** * @author Tilen Faganel diff --git a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/utils/PersistenceUtils.java b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/utils/PersistenceUtils.java index 17bfa072..2d7dbe2b 100644 --- a/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/utils/PersistenceUtils.java +++ b/components/jpa/common/src/main/java/com/kumuluz/ee/jpa/common/utils/PersistenceUtils.java @@ -21,12 +21,12 @@ package com.kumuluz.ee.jpa.common.utils; import com.kumuluz.ee.jpa.common.TransactionType; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; diff --git a/components/jpa/eclipselink/pom.xml b/components/jpa/eclipselink/pom.xml index 8070f35a..55018077 100644 --- a/components/jpa/eclipselink/pom.xml +++ b/components/jpa/eclipselink/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jpa com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -32,11 +32,11 @@ org.eclipse.persistence - javax.persistence + jakarta.persistence org.glassfish - javax.json + jakarta.json diff --git a/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzPlatform.java b/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzPlatform.java index 24926106..c4c16489 100644 --- a/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzPlatform.java +++ b/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzPlatform.java @@ -17,11 +17,12 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jpa.eclipselink; import org.eclipse.persistence.platform.server.ServerPlatformBase; import org.eclipse.persistence.sessions.DatabaseSession; +import org.eclipse.persistence.sessions.ExternalTransactionController; /** * @author Marcos Koch Salvador @@ -34,7 +35,7 @@ public KumuluzPlatform(DatabaseSession newDatabaseSession) { } @Override - public Class getExternalTransactionControllerClass() { + public Class getExternalTransactionControllerClass() { return KumuluzTransactionController.class; } diff --git a/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzTransactionController.java b/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzTransactionController.java index ccb188b2..7748e50a 100644 --- a/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzTransactionController.java +++ b/components/jpa/eclipselink/src/main/java/com/kumuluz/ee/jpa/eclipselink/KumuluzTransactionController.java @@ -23,7 +23,7 @@ import com.kumuluz.ee.jta.common.JtaProvider; import org.eclipse.persistence.transaction.JTATransactionController; -import javax.transaction.TransactionManager; +import jakarta.transaction.TransactionManager; /** * @author Marcos Koch Salvador diff --git a/components/jpa/hibernate/pom.xml b/components/jpa/hibernate/pom.xml index 5fe0379f..c4a748d4 100644 --- a/components/jpa/hibernate/pom.xml +++ b/components/jpa/hibernate/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jpa com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -26,16 +26,16 @@ - org.hibernate + org.hibernate.orm hibernate-core ${hibernate.version} org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec + jboss-transaction-api_1.3_spec - org.jboss + io.smallrye jandex @@ -53,7 +53,7 @@ - org.jboss + io.smallrye jandex @@ -70,9 +70,15 @@ - javax.xml.bind - jaxb-api - ${jaxb-api.version} + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta-xml-bind-api.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb-impl.version} + runtime diff --git a/components/jpa/pom.xml b/components/jpa/pom.xml index 03a2d8c7..94c3af69 100644 --- a/components/jpa/pom.xml +++ b/components/jpa/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/jsf/mojarra/pom.xml b/components/jsf/mojarra/pom.xml index fb375c8a..ca350ed6 100644 --- a/components/jsf/mojarra/pom.xml +++ b/components/jsf/mojarra/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jsf com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/components/jsf/pom.xml b/components/jsf/pom.xml index afacce78..2a10044d 100644 --- a/components/jsf/pom.xml +++ b/components/jsf/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/json-b/pom.xml b/components/json-b/pom.xml index da09a5d0..bda1fea4 100644 --- a/components/json-b/pom.xml +++ b/components/json-b/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/json-b/yasson/pom.xml b/components/json-b/yasson/pom.xml index 469f99a1..23ca650c 100644 --- a/components/json-b/yasson/pom.xml +++ b/components/json-b/yasson/pom.xml @@ -5,7 +5,7 @@ kumuluzee-json-b com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -26,11 +26,11 @@ ${yasson.version} - javax.json - javax.json-api + jakarta.json + jakarta.json-api - javax.enterprise + jakarta.enterprise cdi-api @@ -47,15 +47,15 @@ org.glassfish - javax.json + jakarta.json org.eclipse yasson - javax.json.bind - javax.json.bind-api + jakarta.json.bind + jakarta.json.bind-api diff --git a/components/json-p/jsonp/pom.xml b/components/json-p/jsonp/pom.xml index 17cbf11e..a7a9743d 100644 --- a/components/json-p/jsonp/pom.xml +++ b/components/json-p/jsonp/pom.xml @@ -5,7 +5,7 @@ kumuluzee-json-p com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -22,7 +22,7 @@ org.glassfish - javax.json + jakarta.json ${jsonp-impl.version} @@ -37,11 +37,11 @@ org.glassfish - javax.json + jakarta.json - javax.ws.rs - javax.ws.rs-api + jakarta.ws.rs + jakarta.ws.rs-api diff --git a/components/json-p/jsonp/src/main/java/com/kumuluz/ee/jsonp/configuration/utils/JsonConfigurationUtil.java b/components/json-p/jsonp/src/main/java/com/kumuluz/ee/jsonp/configuration/utils/JsonConfigurationUtil.java index a6250c33..0f50c5bc 100644 --- a/components/json-p/jsonp/src/main/java/com/kumuluz/ee/jsonp/configuration/utils/JsonConfigurationUtil.java +++ b/components/json-p/jsonp/src/main/java/com/kumuluz/ee/jsonp/configuration/utils/JsonConfigurationUtil.java @@ -21,8 +21,8 @@ package com.kumuluz.ee.jsonp.configuration.utils; import com.kumuluz.ee.configuration.utils.ConfigurationUtil; +import jakarta.json.*; -import javax.json.*; import java.util.Optional; /** diff --git a/components/json-p/pom.xml b/components/json-p/pom.xml index 5c73eb62..30a97267 100644 --- a/components/json-p/pom.xml +++ b/components/json-p/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/jsp/jetty/pom.xml b/components/jsp/jetty/pom.xml index c3395f0d..8aedf77a 100644 --- a/components/jsp/jetty/pom.xml +++ b/components/jsp/jetty/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jsp com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -30,15 +30,15 @@ apache-el - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/components/jsp/jetty/src/test/java/com/kumuluz/ee/jetty/jsp/test/JspTest.java b/components/jsp/jetty/src/test/java/com/kumuluz/ee/jetty/jsp/test/JspTest.java index 62600e47..7077ee90 100644 --- a/components/jsp/jetty/src/test/java/com/kumuluz/ee/jetty/jsp/test/JspTest.java +++ b/components/jsp/jetty/src/test/java/com/kumuluz/ee/jetty/jsp/test/JspTest.java @@ -17,10 +17,10 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jetty.jsp.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Tilen diff --git a/components/jsp/pom.xml b/components/jsp/pom.xml index fd9df659..d88cf321 100644 --- a/components/jsp/pom.xml +++ b/components/jsp/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/jta/common/pom.xml b/components/jta/common/pom.xml index d69f99d5..24b9b519 100644 --- a/components/jta/common/pom.xml +++ b/components/jta/common/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jta com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -43,8 +43,8 @@ jboss-annotations-api_1.3_spec - org.jboss.spec.javax.el - jboss-el-api_3.0_spec + org.jboss.spec.jakarta.el + jboss-el-api_5.0_spec org.jboss.spec.javax.interceptor diff --git a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaProvider.java b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaProvider.java index a125271c..3d5598ae 100644 --- a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaProvider.java +++ b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaProvider.java @@ -22,11 +22,11 @@ import com.kumuluz.ee.common.exceptions.KumuluzServerException; import io.agroal.api.transaction.TransactionIntegration; +import jakarta.transaction.Status; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.TransactionSynchronizationRegistry; +import jakarta.transaction.UserTransaction; -import javax.transaction.Status; -import javax.transaction.TransactionManager; -import javax.transaction.TransactionSynchronizationRegistry; -import javax.transaction.UserTransaction; import java.util.Arrays; import java.util.Iterator; import java.util.List; diff --git a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaTransactionServices.java b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaTransactionServices.java index 98e8104b..0b2b59e4 100644 --- a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaTransactionServices.java +++ b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/JtaTransactionServices.java @@ -17,14 +17,15 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jta.common; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Synchronization; +import jakarta.transaction.SystemException; +import jakarta.transaction.UserTransaction; import org.jboss.weld.transaction.spi.TransactionServices; -import javax.transaction.Synchronization; -import javax.transaction.SystemException; -import javax.transaction.UserTransaction; /** * @author Marcos Koch Salvador @@ -36,7 +37,7 @@ public class JtaTransactionServices implements TransactionServices { public void registerSynchronization(Synchronization synchronizedObserver) { try { JtaProvider.getInstance().getTransactionManager().getTransaction().registerSynchronization(synchronizedObserver); - } catch (IllegalStateException | javax.transaction.RollbackException | SystemException e) { + } catch (IllegalStateException | RollbackException | SystemException e) { throw new RuntimeException(e); } } diff --git a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/datasources/JtaXAConnectionWrapper.java b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/datasources/JtaXAConnectionWrapper.java index fc88dc0e..3b925098 100644 --- a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/datasources/JtaXAConnectionWrapper.java +++ b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/datasources/JtaXAConnectionWrapper.java @@ -17,17 +17,17 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jta.common.datasources; import com.kumuluz.ee.jta.common.JtaProvider; import com.kumuluz.ee.jta.common.utils.TxUtils; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Synchronization; +import jakarta.transaction.SystemException; +import jakarta.transaction.TransactionManager; import javax.sql.XAConnection; -import javax.transaction.RollbackException; -import javax.transaction.Synchronization; -import javax.transaction.SystemException; -import javax.transaction.TransactionManager; import javax.transaction.xa.XAResource; import java.sql.*; import java.util.Collections; diff --git a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/utils/TxUtils.java b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/utils/TxUtils.java index 2c7ce348..f9fa3b31 100644 --- a/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/utils/TxUtils.java +++ b/components/jta/common/src/main/java/com/kumuluz/ee/jta/common/utils/TxUtils.java @@ -17,15 +17,15 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jta.common.utils; import com.kumuluz.ee.jta.common.JtaProvider; import com.kumuluz.ee.jta.common.exceptions.CannotRetrieveTxException; +import jakarta.transaction.SystemException; +import jakarta.transaction.Transaction; +import jakarta.transaction.TransactionManager; -import javax.transaction.SystemException; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; /** * @author Tilen Faganel diff --git a/components/jta/narayana/pom.xml b/components/jta/narayana/pom.xml index d45c3b1d..fc194c97 100644 --- a/components/jta/narayana/pom.xml +++ b/components/jta/narayana/pom.xml @@ -5,7 +5,7 @@ kumuluzee-jta com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -27,7 +27,7 @@ org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec + jboss-transaction-api_1.3_spec org.jboss.spec.javax.resource diff --git a/components/jta/narayana/src/main/java/com/kumuluz/ee/jta/narayana/NarayanaJtaProvider.java b/components/jta/narayana/src/main/java/com/kumuluz/ee/jta/narayana/NarayanaJtaProvider.java index 7a9ad7e7..3643ed69 100644 --- a/components/jta/narayana/src/main/java/com/kumuluz/ee/jta/narayana/NarayanaJtaProvider.java +++ b/components/jta/narayana/src/main/java/com/kumuluz/ee/jta/narayana/NarayanaJtaProvider.java @@ -17,7 +17,7 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jta.narayana; import com.arjuna.ats.jta.common.JTAEnvironmentBean; @@ -25,8 +25,10 @@ import com.kumuluz.ee.jta.common.JtaProvider; import io.agroal.api.transaction.TransactionIntegration; import io.agroal.narayana.NarayanaTransactionIntegration; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.TransactionSynchronizationRegistry; +import jakarta.transaction.UserTransaction; -import javax.transaction.*; import java.util.HashMap; import java.util.Map; diff --git a/components/jta/pom.xml b/components/jta/pom.xml index 3ffc5004..8611a69a 100644 --- a/components/jta/pom.xml +++ b/components/jta/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/pom.xml b/components/pom.xml index dc47e7c6..0a20fccc 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/components/websocket/jetty/pom.xml b/components/websocket/jetty/pom.xml index 0520c99c..c6fcb70d 100644 --- a/components/websocket/jetty/pom.xml +++ b/components/websocket/jetty/pom.xml @@ -5,7 +5,7 @@ kumuluzee-websocket com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -32,13 +32,13 @@ org.eclipse.jetty.websocket - websocket-javax-server - ${jetty.version} + websocket-jakarta-server + ${jetty-websocket.version} org.eclipse.jetty.websocket - websocket-javax-client - ${jetty.version} + websocket-jakarta-client + ${jetty-websocket.version} diff --git a/components/websocket/pom.xml b/components/websocket/pom.xml index 3deddda8..a8b71b58 100644 --- a/components/websocket/pom.xml +++ b/components/websocket/pom.xml @@ -5,7 +5,7 @@ kumuluzee-components com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/core/pom.xml b/core/pom.xml index 7bbf9c41..4c1a4ada 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -26,8 +26,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/core/src/main/java/com/kumuluz/ee/EeApplication.java b/core/src/main/java/com/kumuluz/ee/EeApplication.java index 47a18831..84cd9bb2 100644 --- a/core/src/main/java/com/kumuluz/ee/EeApplication.java +++ b/core/src/main/java/com/kumuluz/ee/EeApplication.java @@ -17,7 +17,7 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee; import com.kumuluz.ee.common.*; @@ -47,7 +47,6 @@ import java.util.logging.Handler; import java.util.logging.LogManager; import java.util.logging.Logger; -import java.util.stream.Collectors; /** * @author Tilen Faganel @@ -134,7 +133,7 @@ private void initialize() { // after configuration sources have been initialized. This is because the property must be set // before any calls are made to LogManager or Logger. Some of the external configuration libraries // can and do in fact call the methods so this reorder is necessary. - if (logsExtension!=null) { + if (logsExtension != null) { logsExtension.load(); } @@ -187,24 +186,24 @@ private void initialize() { List eeRuntimeComponents = eeComponents.stream() .map(e -> new EeRuntimeComponent(e.getType(), e.getName())) - .collect(Collectors.toList()); + .toList(); - List serverEeRuntimeComponents = Arrays.stream(server.getProvidedEeComponents()) + List serverEeRuntimeComponents = new ArrayList<>(Arrays.stream(server.getProvidedEeComponents()) .map(c -> new EeRuntimeComponent(c, server.getName())) - .collect(Collectors.toList()); + .toList()); serverEeRuntimeComponents.addAll(eeRuntimeComponents); eeRuntimeInternal.setEeComponents(serverEeRuntimeComponents); - List eeRuntimeExtensions = eeExtensions.stream() - .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).collect(Collectors.toList()); + List eeRuntimeExtensions = new ArrayList<>(eeExtensions.stream() + .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).toList()); eeRuntimeExtensions.addAll(eeConfigExtensions.stream() - .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).collect(Collectors.toList())); + .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).toList()); eeRuntimeExtensions.addAll(eeLogsExtensions.stream() - .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).collect(Collectors.toList())); + .map(e -> new EeRuntimeExtension(e.getGroup(), e.getName())).toList()); eeRuntimeInternal.setEeExtensions(eeRuntimeExtensions); @@ -226,9 +225,8 @@ private void initialize() { List sources = extension.getExtension().getConfigurationSources(); - if (sources == null || sources.size() == 0) { - //noinspection deprecation - sources = Collections.singletonList(extension.getExtension().getConfigurationSource()); + if (sources == null || sources.isEmpty()) { + sources = extension.getExtension().getConfigurationSources(); } for (ConfigurationSource source : sources) { @@ -260,17 +258,15 @@ private void initialize() { server.getServer().initServer(); // Depending on the server type, initiate server specific functionality - if (server.getServer() instanceof ServletServer) { - - ServletServer servletServer = (ServletServer) server.getServer(); + if (server.getServer() instanceof ServletServer servletServer) { List allExtensions = new ArrayList<>(); allExtensions.addAll(eeExtensions.stream().map(ExtensionWrapper::getExtension) - .collect(Collectors.toList())); + .toList()); allExtensions.addAll(eeConfigExtensions.stream().map(ExtensionWrapper::getExtension) - .collect(Collectors.toList())); + .toList()); allExtensions.addAll(eeLogsExtensions.stream().map(ExtensionWrapper::getExtension) - .collect(Collectors.toList())); + .toList()); servletServer.initWebContext(collectScanLibraries(allExtensions)); // Create and register datasources to the underlying server @@ -347,7 +343,7 @@ private void processKumuluzServer(KumuluzServer kumuluzServer) { private List processEeComponents(List components) { - Map eeComp = new HashMap<>(); + Map eeComp = new EnumMap<>(EeComponentType.class); // Wrap components with their metadata and check for duplicates for (Component c : components) { @@ -389,7 +385,7 @@ private List processEeComponents(List components) ComponentWrapper depComp = eeComp.get(dep.value()); - // Check all posible locations for the dependency (Components and Server) + // Check all possible locations for the dependency (Components and Server) if (depComp != null) { depCompName = depComp.getName(); @@ -532,7 +528,7 @@ private void processEeExtensionDependencies(List ext : extensions) { for (EeComponentDependency dep : ext.getDependencies()) { diff --git a/core/src/test/java/com/kumuluz/ee/test/ExampleTest.java b/core/src/test/java/com/kumuluz/ee/test/ExampleTest.java index 30ae995c..f5aa24e5 100644 --- a/core/src/test/java/com/kumuluz/ee/test/ExampleTest.java +++ b/core/src/test/java/com/kumuluz/ee/test/ExampleTest.java @@ -20,17 +20,17 @@ */ package com.kumuluz.ee.test; -import org.junit.Assert; -import org.junit.Test; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Tilen Faganel */ -public class ExampleTest { +class ExampleTest { @Test - public void testAddition() { - - Assert.assertEquals(1 + 2, 3); + void testAddition() { + Assertions.assertEquals(3, 1+2); } } diff --git a/pom.xml b/pom.xml index b8a49e0f..6c215591 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.kumuluz.ee kumuluzee pom - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT common core @@ -29,67 +29,73 @@ https://ee.kumuluz.com - 11 - 11 + 21 + 21 UTF-8 - 2.3.1 - 1.1.1 - 2.3.5 + 4.0.1 + 4.0.4 + 2.1.2 + 4.0.2 - 1.3.5 - 1.0.3 - 1.2.5 - 4.0.4 - 2.3.6 - 3.0.3 - 2.0.2 - 2.2.3 - 2.1.6 - 2.3.3 - 2.3.2 - 1.1.2 - 2.0.2 - 1.1.6 - 1.0.2 - 1.3.3 - 1.7.4 - 1.6.7 + 10.0.0 + 2.1.1 + 2.0.1 + 2.1.0 + 6.0.0 + 3.1.1 + 5.0.1 + 4.0.1 + 3.1.0 + 3.1.0 + 4.0.1 + 4.0.1 + 2.1.1 + 3.0.2 + 2.1.3 + 3.0.0 + 2.0.1 + 2.1.0 + 2.1.2 - 2.4.2.Final - 3.3.2.Final - 1.5.1 - 3.27.0-GA - 1.9 - 1.27 - 4.13.1 - 3.8.2 - 3.6.1 - 2.3.2 + 3.1.5 + 3.5.3.Final + 1.6.0 + 3.29.2-GA + 2.2 + 2.2 + 5.10.1 + 3.9.5 + 3.9.5 + 3.10.2 + 2.4.0 - 3.2.0 - 3.2.0 - 3.6.0 - 3.8.1 - 3.1.2 + 3.3.0 + 3.3.1 + 3.10.2 + 3.11.0 + 3.6.1 + 3.1.0 - 10.0.9 - 2.0.0-alpha6 - 3.0.3 - 3.1.8.Final - 6.2.0.Final - 2.34 - 2.12.0 - 2.4.6 - 3.4.4 - 5.5.7.Final - 2.7.10 - 2.3.16 - 1.1.4 - 1.0.8 - 5.10.6.Final - 7.6.0.Final - 1.6.2 + 11.0.18 + 11.0.18 + 2.0.5 + 4.0.2 + 5.1.2.Final + 8.0.1.Final + 3.1.3 + 2.15.3 + 4.0.3 + 4.0.3 + 6.4.0.Final + 4.0.2 + 4.0.4 + 2.0.1 + 3.0.3 + 7.0.0.Final + 8.0.0.Final + 2.0.1 + 1.6.13 @@ -361,6 +367,12 @@ + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee-api.version} + provided + jakarta.annotation jakarta.annotation-api @@ -466,7 +478,7 @@ pom - org.jboss + io.smallrye jandex ${jandex.version} @@ -496,9 +508,15 @@ ${yaml.version} - junit - junit + org.junit.jupiter + junit-jupiter ${junit.version} + test + + + org.apache.maven + maven-core + ${maven-core.version} org.apache.maven @@ -523,7 +541,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.5 + ${nexus.staging.plugin.version} true ossrh @@ -542,7 +560,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + ${maven-gpg-plugin.version} sign-artifacts diff --git a/profiles/micro-profile-1.0/pom.xml b/profiles/micro-profile-1.0/pom.xml index daa86a21..33dcebbd 100644 --- a/profiles/micro-profile-1.0/pom.xml +++ b/profiles/micro-profile-1.0/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-1.1/pom.xml b/profiles/micro-profile-1.1/pom.xml index b77131be..893e0eb7 100644 --- a/profiles/micro-profile-1.1/pom.xml +++ b/profiles/micro-profile-1.1/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-1.2/pom.xml b/profiles/micro-profile-1.2/pom.xml index e91e3847..58bef364 100644 --- a/profiles/micro-profile-1.2/pom.xml +++ b/profiles/micro-profile-1.2/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-1.3/pom.xml b/profiles/micro-profile-1.3/pom.xml index 1198220d..8e553b3e 100644 --- a/profiles/micro-profile-1.3/pom.xml +++ b/profiles/micro-profile-1.3/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-1.4/pom.xml b/profiles/micro-profile-1.4/pom.xml index ffcfb0ed..d334c094 100644 --- a/profiles/micro-profile-1.4/pom.xml +++ b/profiles/micro-profile-1.4/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-2.0/pom.xml b/profiles/micro-profile-2.0/pom.xml index 24447269..809aa48f 100644 --- a/profiles/micro-profile-2.0/pom.xml +++ b/profiles/micro-profile-2.0/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-2.1/pom.xml b/profiles/micro-profile-2.1/pom.xml index d15ef60f..5380b0d1 100644 --- a/profiles/micro-profile-2.1/pom.xml +++ b/profiles/micro-profile-2.1/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-2.2/pom.xml b/profiles/micro-profile-2.2/pom.xml index 250fab67..dc8c0f12 100644 --- a/profiles/micro-profile-2.2/pom.xml +++ b/profiles/micro-profile-2.2/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-3.0/pom.xml b/profiles/micro-profile-3.0/pom.xml index 0dbf7766..11344e07 100644 --- a/profiles/micro-profile-3.0/pom.xml +++ b/profiles/micro-profile-3.0/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-3.1/pom.xml b/profiles/micro-profile-3.1/pom.xml index 57b35938..d33ee37d 100644 --- a/profiles/micro-profile-3.1/pom.xml +++ b/profiles/micro-profile-3.1/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-3.2/pom.xml b/profiles/micro-profile-3.2/pom.xml index a4c89e88..e7cf0fbb 100644 --- a/profiles/micro-profile-3.2/pom.xml +++ b/profiles/micro-profile-3.2/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile-3.3/pom.xml b/profiles/micro-profile-3.3/pom.xml index 9a0e1494..bf9ad72a 100644 --- a/profiles/micro-profile-3.3/pom.xml +++ b/profiles/micro-profile-3.3/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/micro-profile/pom.xml b/profiles/micro-profile/pom.xml index d076a41b..fd0795e1 100644 --- a/profiles/micro-profile/pom.xml +++ b/profiles/micro-profile/pom.xml @@ -5,7 +5,7 @@ kumuluzee-profiles com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/profiles/pom.xml b/profiles/pom.xml index d0cd9810..c9abc9b6 100644 --- a/profiles/pom.xml +++ b/profiles/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/servlet/jetty/pom.xml b/servlet/jetty/pom.xml index be20c82a..8f45ae09 100644 --- a/servlet/jetty/pom.xml +++ b/servlet/jetty/pom.xml @@ -5,7 +5,7 @@ kumuluzee-servlet com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 @@ -72,8 +72,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyFactory.java b/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyFactory.java index 1011ebe2..6d7166f7 100644 --- a/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyFactory.java +++ b/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyFactory.java @@ -87,7 +87,7 @@ private Connector[] createConnectors(final Server server) { throw new IllegalStateException("Both the HTTP and HTTPS connectors can not be disabled. Please enable at least one."); } - if (serverConfig.getForceHttps() && (httpsConfig == null || !Boolean.TRUE.equals(httpsConfig.getEnabled()))) { + if (Boolean.TRUE.equals(serverConfig.getForceHttps()) && (httpsConfig == null || !Boolean.TRUE.equals(httpsConfig.getEnabled()))) { throw new IllegalStateException("You must enable the HTTPS connector in order to force redirects to it (`kumuluzee.server" + ".https.enabled` must be true)."); } @@ -108,29 +108,12 @@ private Connector[] createConnectors(final Server server) { httpsConfig.getPort() == null ? ServerConnectorConfig.DEFAULT_HTTPS_PORT : httpsConfig.getPort()); } - ServerConnector httpConnector; - - HttpConnectionFactory http = new HttpConnectionFactory(httpConfiguration); - - if (httpConfig.getHttp2()) { - - HTTP2CServerConnectionFactory http2c = new HTTP2CServerConnectionFactory(httpConfiguration); - - httpConnector = new ServerConnector(server, http, http2c); - } else { - - httpConnector = new ServerConnector(server, http); - } - - httpConnector.setPort(httpConfig.getPort() == null ? ServerConnectorConfig.DEFAULT_HTTP_PORT : httpConfig.getPort()); - httpConnector.setHost(httpConfig.getAddress()); - - httpConnector.setIdleTimeout(httpConfig.getIdleTimeout()); + ServerConnector httpConnector = getServerConnector(server, httpConfiguration, httpConfig); connectors.add(httpConnector); } - if (httpsConfig != null && httpsConfig.getEnabled() != null && httpsConfig.getEnabled()) { + if (httpsConfig != null && httpsConfig.getEnabled() != null && Boolean.TRUE.equals(httpsConfig.getEnabled())) { if (StringUtils.isNullOrEmpty(httpsConfig.getKeystorePath())) { throw new IllegalStateException("Cannot create SSL connector; keystore path not specified."); @@ -181,7 +164,7 @@ private Connector[] createConnectors(final Server server) { sslContextFactory.setIncludeCipherSuites(httpsConfig.getSslCiphers().toArray(new String[0])); } - if (httpsConfig.getHttp2()) { + if (Boolean.TRUE.equals(httpsConfig.getHttp2())) { sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR); sslContextFactory.setUseCipherSuitesOrder(true); @@ -218,4 +201,26 @@ private Connector[] createConnectors(final Server server) { return connectors.toArray(new ServerConnector[0]); } + + private static ServerConnector getServerConnector(Server server, HttpConfiguration httpConfiguration, ServerConnectorConfig httpConfig) { + ServerConnector httpConnector; + + HttpConnectionFactory http = new HttpConnectionFactory(httpConfiguration); + + if (httpConfig.getHttp2()) { + + HTTP2CServerConnectionFactory http2c = new HTTP2CServerConnectionFactory(httpConfiguration); + + httpConnector = new ServerConnector(server, http, http2c); + } else { + + httpConnector = new ServerConnector(server, http); + } + + httpConnector.setPort(httpConfig.getPort() == null ? ServerConnectorConfig.DEFAULT_HTTP_PORT : httpConfig.getPort()); + httpConnector.setHost(httpConfig.getAddress()); + + httpConnector.setIdleTimeout(httpConfig.getIdleTimeout()); + return httpConnector; + } } diff --git a/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyServletServer.java b/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyServletServer.java index 904c7a8d..bb809594 100644 --- a/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyServletServer.java +++ b/servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyServletServer.java @@ -17,7 +17,7 @@ * out of or in connection with the software or the use or other dealings in the * software. See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package com.kumuluz.ee.jetty; import com.kumuluz.ee.common.ServletServer; @@ -30,6 +30,10 @@ import com.kumuluz.ee.common.exceptions.KumuluzServerException; import com.kumuluz.ee.common.servlet.ServletWrapper; import com.kumuluz.ee.common.utils.ResourceUtils; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.Servlet; +import jakarta.transaction.UserTransaction; import org.eclipse.jetty.annotations.AnnotationConfiguration; import org.eclipse.jetty.plus.jndi.Resource; import org.eclipse.jetty.plus.jndi.Transaction; @@ -46,11 +50,7 @@ import org.eclipse.jetty.webapp.*; import javax.naming.NamingException; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.Servlet; import javax.sql.DataSource; -import javax.transaction.UserTransaction; import java.io.IOException; import java.util.*; import java.util.logging.Level; @@ -198,25 +198,27 @@ public void initWebContext(List scanLibraries) { final ArrayList handlers = new ArrayList<>(); // Set the secured redirect handler in case the force https option is selected - if( serverConfig.getForceHttps()) { + if (Boolean.TRUE.equals(serverConfig.getForceHttps())) { handlers.add(new SecuredRedirectHandler()); + + server.setHandler(new SecuredRedirectHandler()); } // Set the gzip handler in case the use gzip option is selected - if(gzipConfig != null && gzipConfig.getEnabled()) { + if (gzipConfig != null && gzipConfig.getEnabled()) { GzipHandler gzipHandler = new GzipHandler(); - if(gzipConfig.getMinGzipSize() != null) + if (gzipConfig.getMinGzipSize() != null) gzipHandler.setMinGzipSize(gzipConfig.getMinGzipSize()); - if(gzipConfig.getIncludedMethods() != null) + if (gzipConfig.getIncludedMethods() != null) gzipHandler.setIncludedMethods(gzipConfig.getIncludedMethods().toArray(new String[0])); - if(gzipConfig.getIncludedMimeTypes() != null) + if (gzipConfig.getIncludedMimeTypes() != null) gzipHandler.setIncludedMimeTypes(gzipConfig.getIncludedMimeTypes().toArray(new String[0])); - if(gzipConfig.getExcludedMimeTypes() != null) + if (gzipConfig.getExcludedMimeTypes() != null) gzipHandler.setExcludedMimeTypes(gzipConfig.getExcludedMimeTypes().toArray(new String[0])); - if(gzipConfig.getExcludedPaths() != null) + if (gzipConfig.getExcludedPaths() != null) gzipHandler.setExcludedPaths(gzipConfig.getExcludedPaths().toArray(new String[0])); - if(gzipConfig.getIncludedPaths() != null) + if (gzipConfig.getIncludedPaths() != null) gzipHandler.setIncludedPaths(gzipConfig.getIncludedPaths().toArray(new String[0])); gzipHandler.setHandler(appContext); @@ -230,7 +232,6 @@ public void initWebContext(List scanLibraries) { server.setHandler(handlerList); } else { - server.setHandler(appContext); } } diff --git a/servlet/pom.xml b/servlet/pom.xml index 03a339cb..720cf1c1 100644 --- a/servlet/pom.xml +++ b/servlet/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom diff --git a/tools/loader/pom.xml b/tools/loader/pom.xml index 2cdb923b..c1d86380 100644 --- a/tools/loader/pom.xml +++ b/tools/loader/pom.xml @@ -5,7 +5,7 @@ kumuluzee-tools com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/tools/maven-plugin/pom.xml b/tools/maven-plugin/pom.xml index 2dcb7dd7..9c3036bc 100644 --- a/tools/maven-plugin/pom.xml +++ b/tools/maven-plugin/pom.xml @@ -5,7 +5,7 @@ kumuluzee-tools com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 maven-plugin @@ -31,6 +31,11 @@ maven-plugin-api provided + + org.apache.maven + maven-core + provided + org.apache.maven.plugin-tools maven-plugin-annotations diff --git a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/AbstractCopyDependenciesMojo.java b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/AbstractCopyDependenciesMojo.java index 8d96f526..fbf82497 100644 --- a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/AbstractCopyDependenciesMojo.java +++ b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/AbstractCopyDependenciesMojo.java @@ -46,6 +46,7 @@ public abstract class AbstractCopyDependenciesMojo extends AbstractMojo { @Parameter(defaultValue = "${session}", readonly = true, required = true) protected MavenSession session; + @Component protected BuildPluginManager buildPluginManager; @Parameter diff --git a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/CopyDependenciesMojo.java b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/CopyDependenciesMojo.java index e932fa40..08957f9c 100644 --- a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/CopyDependenciesMojo.java +++ b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/CopyDependenciesMojo.java @@ -20,11 +20,8 @@ */ package com.kumuluz.ee.maven.plugin; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.*; -import org.apache.maven.project.MavenProject; /** * Copy dependencies and prepare for execution in an exploded class and dependency runtime. diff --git a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunExplodedMojo.java b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunExplodedMojo.java index 1e7c7b96..aeef2465 100644 --- a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunExplodedMojo.java +++ b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunExplodedMojo.java @@ -20,11 +20,8 @@ */ package com.kumuluz.ee.maven.plugin; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.*; -import org.apache.maven.project.MavenProject; import java.io.File; @@ -55,7 +52,7 @@ public void execute() throws MojoExecutionException { plugin( groupId("org.codehaus.mojo"), artifactId("exec-maven-plugin"), - version("1.6.0") + version("3.1.0") ), goal("java"), configuration( diff --git a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunJarMojo.java b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunJarMojo.java index ae3cf30e..c97bb73d 100644 --- a/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunJarMojo.java +++ b/tools/maven-plugin/src/main/java/com/kumuluz/ee/maven/plugin/RunJarMojo.java @@ -20,13 +20,9 @@ */ package com.kumuluz.ee.maven.plugin; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.project.MavenProject; import static org.twdata.maven.mojoexecutor.MojoExecutor.*; @@ -59,7 +55,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { plugin( groupId("org.codehaus.mojo"), artifactId("exec-maven-plugin"), - version("1.6.0") + version("3.1.0") ), goal("exec"), configuration( diff --git a/tools/pom.xml b/tools/pom.xml index 8f4ca0d3..62a299b3 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -5,7 +5,7 @@ kumuluzee com.kumuluz.ee - 4.2.0-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 pom