You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2023/02/21 11:07:47 UTC
[cxf] branch 3.5.x-fixes updated: Removing old Jackson version from CXF JAX-RS archetype (#1149)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.5.x-fixes by this push:
new a05acf795b Removing old Jackson version from CXF JAX-RS archetype (#1149)
a05acf795b is described below
commit a05acf795b8138f54857848e304ffc548c10dfa7
Author: Colm O hEigeartaigh <co...@users.noreply.github.com>
AuthorDate: Tue Feb 21 11:06:11 2023 +0000
Removing old Jackson version from CXF JAX-RS archetype (#1149)
(cherry picked from commit 96bf7ded9f4c74a8eaa2f30287e9f296260510ec)
(cherry picked from commit 608c86e3aeb9eba6c60984c20c640207d6db9afd)
---
.../src/main/resources/archetype-resources/pom.xml | 20 ++++++--------------
.../src/main/webapp/WEB-INF/beans.xml | 5 ++---
.../src/test/java/HelloWorldIT.java | 8 ++------
3 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/pom.xml b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/pom.xml
index 32e49656d8..104b4fef75 100644
--- a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/pom.xml
+++ b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/pom.xml
@@ -7,9 +7,6 @@
<packaging>war</packaging>
<name>Simple CXF JAX-RS webapp service using spring configuration</name>
<description>Simple CXF JAX-RS webapp service using spring configuration</description>
- <properties>
- <jackson.version>1.8.6</jackson.version>
- </properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -22,19 +19,14 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- <version>${jackson.version}</version>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>${cxf.jackson.version}</version>
</dependency>
<dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-jaxrs</artifactId>
- <version>${jackson.version}</version>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${cxf.spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
index f7eff67794..cfa32e504a 100644
--- a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
+++ b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
@@ -7,14 +7,13 @@
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<context:property-placeholder/>
<context:annotation-config/>
- <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer"/>
<bean class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"/>
<jaxrs:server id="services" address="/">
<jaxrs:serviceBeans>
<bean class="${package}.HelloWorld"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
- <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
+ <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
</jaxrs:providers>
</jaxrs:server>
-</beans>
\ No newline at end of file
+</beans>
diff --git a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/test/java/HelloWorldIT.java b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/test/java/HelloWorldIT.java
index 0404af33d4..d4d6e44f92 100644
--- a/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/test/java/HelloWorldIT.java
+++ b/maven-plugins/archetypes/cxf-jaxrs-service/src/main/resources/archetype-resources/src/test/java/HelloWorldIT.java
@@ -10,8 +10,6 @@ import javax.ws.rs.core.Response;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.jaxrs.client.WebClient;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.map.MappingJsonFactory;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -35,7 +33,7 @@ public class HelloWorldIT {
@Test
public void testJsonRoundtrip() throws Exception {
List<Object> providers = new ArrayList<>();
- providers.add(new org.codehaus.jackson.jaxrs.JacksonJsonProvider());
+ providers.add(new com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider());
JsonBean inputBean = new JsonBean();
inputBean.setVal1("Maple");
WebClient client = WebClient.create(endpointUrl + "/hello/jsonBean", providers);
@@ -43,9 +41,7 @@ public class HelloWorldIT {
.type("application/json")
.post(inputBean);
assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
- MappingJsonFactory factory = new MappingJsonFactory();
- JsonParser parser = factory.createJsonParser((InputStream)r.getEntity());
- JsonBean output = parser.readValueAs(JsonBean.class);
+ JsonBean output = r.readEntity(JsonBean.class);
assertEquals("Maple", output.getVal2());
}
}