Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXF-8671: Support Jakarta EE 10 #1201

Merged
merged 28 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4af8a3
Update dependencies to Jakarta EE 10
karlvr Mar 21, 2023
f8f3e0d
Remove unnecessary dependency on jakarta.xml.bind-api
karlvr Mar 22, 2023
d10f665
Servlet API 6.0.0
karlvr Mar 22, 2023
97561f7
Jakarta XML Binding 4.0
karlvr Mar 22, 2023
c7dc677
Jakarta Context Dependency Injection 4.0
karlvr Mar 22, 2023
a41f1ea
Fix Maven dependencies
karlvr Mar 22, 2023
2035428
Jakarta RESTful Web Services 3.1
karlvr Mar 22, 2023
e7f3e9a
Update Jakarta EE dependencies for codegen-plugins integration tests
karlvr Mar 22, 2023
6328865
Add missing jakarta.xml.bind-api dependencies for codegen-plugin mave…
karlvr Mar 22, 2023
49e3e17
Correct RetryAfterHeaderProviderTest not accounting for host daylight…
karlvr Mar 23, 2023
e6b6d9a
Upgrade saaj-impl
karlvr Apr 2, 2023
391e6fe
Upgrade undertow
karlvr Apr 2, 2023
d61f8f0
Upgrade istack
karlvr Apr 2, 2023
e66177f
Placeholders for bootstrap API
karlvr Apr 12, 2023
e0f10cc
EntityPart
karlvr Apr 12, 2023
b87e742
Implement RuntimeDelegateImpl
reta Apr 4, 2023
434236a
Partially implement TLS/SSL in SE bootstrap (needs some work on CXF e…
reta Apr 14, 2023
50342d4
Fix cxf-tools-wadlto-jaxrs test cases
reta May 14, 2023
24c079f
Update Spring Boot to 3.1.0, Spring LDAP to 3.1.0, Spring Security to…
reta May 20, 2023
1a3086d
docs: Fix BUILDING.txt fastinstall line
karlvr Jul 4, 2023
1f96a35
Fix compilation and checkstyle issues
reta Sep 19, 2023
dd19b3c
Update Hibernate to 6.2.9.Final
reta Oct 4, 2023
24bcaf1
Update Hibernate to 6.3.1.Final
reta Oct 4, 2023
b06c530
Refactor EntityPartBuilderImpl & EntityPartImpl
reta Oct 31, 2023
181f7e6
Replace JakarteEE 10 BOM with indvidual component versions to simplif…
reta Oct 31, 2023
c26ffb4
Fixed CDI and Security test cases
reta Nov 1, 2023
1f30514
Update Weld to 5.1.2.Final
reta Nov 1, 2023
d4fa37f
Switch JSON-P/JSON-B implementation and fix test cases
reta Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Building
$> mvn
This will compile Apache CXF and run all of the tests in the Apache CXF source
distribution. Alternatively, you can run
$> mvn -Pfastinstall.
$> mvn -Pfastinstall
This will compile Apache CXF without running the tests and takes less
time to build.
Depending on the load of remote Maven repositories, you may have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,20 @@ public ValidationEventHandler getEventHandler() throws JAXBException {
return null;
}

@SuppressWarnings("rawtypes")
@Override
public void setAdapter(XmlAdapter adapter) {
public <A extends XmlAdapter<?, ?>> void setAdapter(A adapter) {
// TODO Auto-generated method stub

}

@SuppressWarnings("rawtypes")
@Override
public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
public <A extends XmlAdapter<?, ?>> void setAdapter(Class<A> type, A adapter) {
// TODO Auto-generated method stub

}

@SuppressWarnings("rawtypes")
@Override
public <A extends XmlAdapter> A getAdapter(Class<A> type) {
public <A extends XmlAdapter<?, ?>> A getAdapter(Class<A> type) {
// TODO Auto-generated method stub
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion distribution/javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-servlet-jakarta</artifactId>
<artifactId>undertow-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@
<artifactId>cxf-rt-rs-service-description-microprofile-openapi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
<classifier>jakarta</classifier>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.microprofile.openapi.OpenApiFeature;
import org.apache.johnzon.jaxrs.jsonb.jaxrs.JsonbJaxrsProvider;
import org.apache.cxf.jaxrs.provider.jsrjsonb.JsrJsonbProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -29,7 +29,7 @@ org.apache.cxf.endpoint.Server server() {
factory.setFeatures(Arrays.asList(openApiFeature()));
factory.setServiceBean(sampleResource());
factory.setAddress("http://localhost:9000/");
factory.setProvider(new JsonbJaxrsProvider<>());
factory.setProvider(new JsrJsonbProvider());
return factory.create();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
</dependency>

<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-servlet-jakarta</artifactId>
</dependency>
<artifactId>undertow-servlet</artifactId>
</dependency>
</dependencies>

<profiles>
Expand Down
2 changes: 1 addition & 1 deletion distribution/src/main/release/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- don't deploy the samples, kind of pointless -->
<maven.deploy.skip>true</maven.deploy.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.spring.boot.version>3.0.12</cxf.spring.boot.version>
<cxf.spring.boot.version>3.1.4</cxf.spring.boot.version>
<cxf.spring.cloud.eureka.version>4.0.3</cxf.spring.cloud.eureka.version>
<cxf.jetty11.version>11.0.17</cxf.jetty11.version>
<cxf.netty.version>4.1.100.Final</cxf.netty.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public boolean isAlternative() {
return false;
}

@Override
public boolean isNullable() {
return false;
}

@Override
public Set<InjectionPoint> getInjectionPoints() {
return Collections.emptySet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.spi.InjectionPoint;
import jakarta.enterprise.inject.spi.InjectionTarget;
import jakarta.enterprise.inject.spi.InjectionTargetFactory;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.extension.ExtensionManagerBus;
Expand All @@ -35,8 +36,8 @@ final class CdiBusBean extends AbstractCXFBean< ExtensionManagerBus > {

private final InjectionTarget<ExtensionManagerBus> injectionTarget;

CdiBusBean(final InjectionTarget<ExtensionManagerBus> injectionTarget) {
this.injectionTarget = injectionTarget;
CdiBusBean(final InjectionTargetFactory<ExtensionManagerBus> injectionTargetFactory) {
this.injectionTarget = injectionTargetFactory.createInjectionTarget(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public <T> Object create(Class<T> cls) {
final CreationalContext<?> context = beanManager.createCreationalContext(bean);

if (!beanManager.isNormalScope(bean.getScope())) {
beanManager.fireEvent(new DisposableCreationalContext(context));
beanManager.getEvent().fire(new DisposableCreationalContext(context));
}

return beanManager.getReference(bean, cls, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ public Object create(CreationalContext<Object> creationalContext) {
return createContextValue();
}

@Override
public boolean isNullable() {
return true;
}

@Override
public Set<Type> getTypes() {
Set<Type> types = super.getTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import jakarta.enterprise.inject.spi.BeforeBeanDiscovery;
import jakarta.enterprise.inject.spi.BeforeShutdown;
import jakarta.enterprise.inject.spi.Extension;
import jakarta.enterprise.inject.spi.InjectionTarget;
import jakarta.enterprise.inject.spi.ProcessAnnotatedType;
import jakarta.enterprise.inject.spi.ProcessBean;
import jakarta.enterprise.inject.spi.ProcessProducerField;
Expand Down Expand Up @@ -164,7 +163,7 @@ void onStartup(@Observes final BeforeBeanDiscovery beforeBeanDiscovery, final Be
"jakarta.servlet.http.HttpServletRequest",
"jakarta.servlet.ServletContext"));
}
beanManager.fireEvent(this);
beanManager.getEvent().fire(this);
}

/**
Expand Down Expand Up @@ -268,9 +267,7 @@ public void injectBus(@Observes final AfterBeanDiscovery event, final BeanManage
final AnnotatedType< ExtensionManagerBus > busAnnotatedType =
beanManager.createAnnotatedType(ExtensionManagerBus.class);

final InjectionTarget<ExtensionManagerBus> busInjectionTarget =
beanManager.createInjectionTarget(busAnnotatedType);
event.addBean(new CdiBusBean(busInjectionTarget));
event.addBean(new CdiBusBean(beanManager.getInjectionTargetFactory(busAnnotatedType)));
}

if (applicationBeans.isEmpty() && !serviceBeans.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import jakarta.enterprise.inject.spi.Annotated;
import jakarta.enterprise.inject.spi.Bean;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.enterprise.inject.spi.InjectionTargetFactory;
import jakarta.enterprise.inject.spi.ProcessBean;
import jakarta.ws.rs.Path;
import org.apache.cxf.Bus;
Expand Down Expand Up @@ -49,9 +50,12 @@ public class JAXRSCdiResourceExtensionTest {
private ProcessBean<Bus> processBean;
@Mock
private Annotated annotated;

@Mock
private InjectionTargetFactory<Object> factory;

@Test
public void shouldNotAddDefaultApplicationWhenNoResourcesDefined() {
when(beanManager.getInjectionTargetFactory(any())).thenReturn(factory);
extension.injectBus(event, beanManager);

verify(event).addBean(any(CdiBusBean.class));
Expand Down Expand Up @@ -80,6 +84,7 @@ public void shouldAddApplicationBeanWhenResourcesProvided() {
when(annotated.isAnnotationPresent(Path.class)).thenReturn(true);
extension.collect(processBean, beanManager);

when(beanManager.getInjectionTargetFactory(any())).thenReturn(factory);
extension.injectBus(event, beanManager);

verify(event).addBean(any(DefaultApplicationBean.class));
Expand Down
10 changes: 5 additions & 5 deletions integration/spring-boot/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>${cxf.servlet-api.group}</groupId>
<artifactId>${cxf.servlet-api.artifact}</artifactId>
<version>${cxf.servlet-api.version}</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${cxf.servlet-api.version}</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions maven-plugins/codegen-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@
</execution>
</executions>
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${cxf.jaxb.version}</version>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${cxf.jaxb.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
</build>
<profiles>
<profile>
<id>java9</id>
<id>java11</id>
<activation>
<jdk>[9,)</jdk>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
Expand All @@ -90,7 +90,7 @@
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.0</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
Expand All @@ -100,7 +100,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
<version>4.0.0</version>
</dependency>
</dependencies>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
</build>
</profile>
<profile>
<id>java9</id>
<id>java11</id>
<activation>
<jdk>[9,)</jdk>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
Expand All @@ -125,7 +125,7 @@
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.0</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
Expand All @@ -135,7 +135,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
<version>4.0.0</version>
</dependency>
</dependencies>
</profile>
Expand Down
8 changes: 4 additions & 4 deletions maven-plugins/codegen-plugin/src/it/mark-generated/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
</build>
<profiles>
<profile>
<id>java9</id>
<id>java11</id>
<activation>
<jdk>[9,)</jdk>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
Expand All @@ -88,7 +88,7 @@
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.0</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
Expand All @@ -98,7 +98,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
<version>4.0.0</version>
</dependency>
</dependencies>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
</build>
<profiles>
<profile>
<id>java9</id>
<id>java11</id>
<activation>
<jdk>[9,)</jdk>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
Expand All @@ -90,7 +90,7 @@
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.0</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
Expand All @@ -100,7 +100,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
<version>4.0.0</version>
</dependency>
</dependencies>
</profile>
Expand Down
Loading