cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [cxf] branch master updated: update to Spring 5, Spring Security 5, Spring Boot 2
Date Wed, 04 Jul 2018 06:21:39 GMT
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new fc656dc  update to Spring 5, Spring Security 5, Spring Boot 2
fc656dc is described below

commit fc656dc1311963f5fc833856984b36b7ccd26042
Author: Dennis Kieselhorst <mail@dekies.de>
AuthorDate: Wed Jul 4 08:21:35 2018 +0200

    update to Spring 5, Spring Security 5, Spring Boot 2
    
    The jax_rs_spring_security sample doesn't work for me, but this is also the case without
the changes so I'll merge this.
---
 .../sample/rs/service/SampleRestApplicationTest.java |  2 +-
 .../jax_rs/spring_boot_scan/application/pom.xml      |  2 +-
 .../sample/rs/service/SampleRestApplication.java     | 17 -----------------
 .../sample/rs/service/SampleRestApplicationTest.java |  2 +-
 .../samples/jax_rs/spring_boot_scan/client/pom.xml   |  2 +-
 .../jax_rs/spring_boot_scan/eureka-registry/pom.xml  |  2 +-
 .../release/samples/jax_rs/spring_security/pom.xml   |  2 +-
 .../src/main/webapp/WEB-INF/beans.xml                |  2 +-
 .../sample/ws/service/SampleWsApplicationTest.java   |  2 +-
 distribution/src/main/release/samples/pom.xml        |  4 ++--
 .../autoconfigure/CxfAutoConfigurationTests.java     |  8 ++++----
 parent/pom.xml                                       |  6 +++---
 rt/rs/security/oauth-parent/oauth2/pom.xml           |  6 ++++++
 rt/rs/security/sso/oidc/pom.xml                      | 20 +++++++++++++-------
 .../test/resources/jaxrs_security/WEB-INF/beans.xml  |  2 ++
 .../resources/jaxrs_security_cglib/WEB-INF/beans.xml |  7 +++++++
 .../jaxrs_security_no_annotations/WEB-INF/beans.xml  |  2 ++
 17 files changed, 47 insertions(+), 41 deletions(-)

diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/src/test/java/sample/rs/service/SampleRestApplicationTest.java
b/distribution/src/main/release/samples/jax_rs/spring_boot/src/test/java/sample/rs/service/SampleRestApplicationTest.java
index d85654a..a424e9d 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot/src/test/java/sample/rs/service/SampleRestApplicationTest.java
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot/src/test/java/sample/rs/service/SampleRestApplicationTest.java
@@ -24,7 +24,7 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
 import org.springframework.test.context.junit4.SpringRunner;
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml
index 060b508..c7b57ea 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml
@@ -52,7 +52,7 @@
         <!-- Eureka Service Discovery Client -->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-eureka</artifactId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
             <version>${spring.cloud.eureka.version}</version>
         </dependency>
         <!-- Actuator  Endpoints -->
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
index 1f3ff56..f085e03 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
@@ -17,32 +17,15 @@
  * under the License.
  */
 package sample.rs.service;
-import java.util.Collections;
-
-import com.codahale.metrics.MetricRegistry;
 
 import org.springframework.boot.SpringApplication;
-import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics;
-import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
-import org.springframework.boot.actuate.metrics.reader.MetricRegistryMetricReader;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-import org.springframework.context.annotation.Bean;
 
 
 @SpringBootApplication
 @EnableEurekaClient
 public class SampleRestApplication {
-    @Bean
-    public MetricRegistry metricRegistry() {
-        return new MetricRegistry();
-    }
-
-    @Bean
-    public MetricsEndpoint metricsEndpoint(final MetricRegistry registry) {
-        return new MetricsEndpoint(Collections.singleton(new MetricReaderPublicMetrics(
-            new MetricRegistryMetricReader(registry))));
-    }
 
     public static void main(String[] args) {
         SpringApplication.run(SampleRestApplication.class, args);
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/test/java/sample/rs/service/SampleRestApplicationTest.java
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/test/java/sample/rs/service/SampleRestApplicationTest.java
index d85654a..a424e9d 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/test/java/sample/rs/service/SampleRestApplicationTest.java
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/test/java/sample/rs/service/SampleRestApplicationTest.java
@@ -24,7 +24,7 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
 import org.springframework.test.context.junit4.SpringRunner;
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/client/pom.xml
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/client/pom.xml
index 842d3e4..eb25130 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/client/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/client/pom.xml
@@ -42,7 +42,7 @@
         <!-- Eureka Service Discovery Client -->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-eureka</artifactId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
             <version>${spring.cloud.eureka.version}</version>
         </dependency>
         <!-- Zest Circuit Breaker used by CXF Failover Feature -->
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/eureka-registry/pom.xml
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/eureka-registry/pom.xml
index 0837fc9..6114d7c 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/eureka-registry/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/eureka-registry/pom.xml
@@ -35,7 +35,7 @@
 
         <dependency>
             <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-eureka-server</artifactId>
+            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml
index 5efb5de..ca4d30b 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml
@@ -32,7 +32,7 @@
     <properties>
         <cxf.version>${project.version}</cxf.version>
         <aspectj.version>1.5.4</aspectj.version>
-        <spring.security.version>3.2.5.RELEASE</spring.security.version>
+        <spring.security.version>5.0.3.RELEASE</spring.security.version>
     </properties>
     <build>
         <finalName>JAXRSSpringSecurity</finalName>
diff --git a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml
b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml
index a46433f..67d60f8 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml
@@ -17,7 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spr [...]
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring- [...]
     <import resource="classpath:META-INF/cxf/cxf.xml"/>
     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
     <jaxrs:server id="bookservice" address="/">
diff --git a/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
b/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
index 53f7277..b645ddb 100644
--- a/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
+++ b/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
 import org.springframework.boot.test.rule.OutputCapture;
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index c3a4329..be09a71 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -30,8 +30,8 @@
         <!-- don't deploy the samples, kind of pointless -->
         <maven.deploy.skip>true</maven.deploy.skip>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <spring.boot.version>1.5.14.RELEASE</spring.boot.version>
-        <spring.cloud.eureka.version>1.3.4.RELEASE</spring.cloud.eureka.version>
+        <spring.boot.version>2.0.3.RELEASE</spring.boot.version>
+        <spring.cloud.eureka.version>2.0.0.RELEASE</spring.cloud.eureka.version>
     </properties>
     <dependencies>
         <dependency>
diff --git a/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java
b/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java
index 34d1283..e869a78 100644
--- a/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java
+++ b/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java
@@ -73,7 +73,7 @@ public class CxfAutoConfigurationTests {
     public void customPathWithTrailingSlash() {
         load(CxfAutoConfiguration.class, "cxf.path=/valid/");
         assertThat(this.context.getBean(ServletRegistrationBean.class).getUrlMappings(),
-                (Matcher<Iterable<? super String>>) hasItem("/valid/*"));
+                (Matcher) hasItem("/valid/*"));
     }
 
     @Test
@@ -82,7 +82,7 @@ public class CxfAutoConfigurationTests {
         assertThat(this.context.getBeansOfType(ServletRegistrationBean.class).size(),
                 equalTo(1));
         assertThat(this.context.getBean(ServletRegistrationBean.class).getUrlMappings(),
-                (Matcher<Iterable<? super String>>) hasItem("/valid/*"));
+                (Matcher) hasItem("/valid/*"));
     }
 
     @Test
@@ -100,8 +100,8 @@ public class CxfAutoConfigurationTests {
                 "spring.cxf.servlet.init.key2=value2");
         ServletRegistrationBean registrationBean = this.context
                 .getBean(ServletRegistrationBean.class);
-        assertThat(registrationBean.getInitParameters(), hasEntry("key1", "value1"));
-        assertThat(registrationBean.getInitParameters(), hasEntry("key2", "value2"));
+        assertThat(registrationBean.getInitParameters(), (Matcher) hasEntry("key1", "value1"));
+        assertThat(registrationBean.getInitParameters(), (Matcher) hasEntry("key2", "value2"));
     }
 
     private void load(Class<?> config, String... environment) {
diff --git a/parent/pom.xml b/parent/pom.xml
index 96bcc2b..11eb1b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -154,9 +154,9 @@
         <cxf.servlet-api-2.5.version>1.2</cxf.servlet-api-2.5.version>
         <cxf.slf4j.version>1.7.25</cxf.slf4j.version>
         <cxf.specs.jaxws.api.version>1.2</cxf.specs.jaxws.api.version>
-        <cxf.spring.version>4.3.18.RELEASE</cxf.spring.version>
-        <cxf.spring.boot.version>1.5.14.RELEASE</cxf.spring.boot.version>
-        <cxf.spring.security.version>4.2.7.RELEASE</cxf.spring.security.version>
+        <cxf.spring.version>5.0.7.RELEASE</cxf.spring.version>
+        <cxf.spring.boot.version>2.0.3.RELEASE</cxf.spring.boot.version>
+        <cxf.spring.security.version>5.0.6.RELEASE</cxf.spring.security.version>
         <cxf.spring.osgi.version>1.2.1</cxf.spring.osgi.version>
         <cxf.spring.ldap.version>2.3.2.RELEASE</cxf.spring.ldap.version>
         <cxf.spring.mock>spring-test</cxf.spring.mock>
diff --git a/rt/rs/security/oauth-parent/oauth2/pom.xml b/rt/rs/security/oauth-parent/oauth2/pom.xml
index e1cebb7..36f1258 100644
--- a/rt/rs/security/oauth-parent/oauth2/pom.xml
+++ b/rt/rs/security/oauth-parent/oauth2/pom.xml
@@ -185,6 +185,12 @@
       <version>1.8.7</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.hibernate.javax.persistence</groupId>
+      <artifactId>hibernate-jpa-2.1-api</artifactId>
+      <version>1.0.2.Final</version>
+      <scope>test</scope>
+    </dependency>
 
   </dependencies>
   <build>
diff --git a/rt/rs/security/sso/oidc/pom.xml b/rt/rs/security/sso/oidc/pom.xml
index 064aeeb..78930d1 100644
--- a/rt/rs/security/sso/oidc/pom.xml
+++ b/rt/rs/security/sso/oidc/pom.xml
@@ -132,13 +132,19 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jta_1.1_spec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>javax.annotation-api</artifactId>
-        </dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.1_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>javax.annotation-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate.javax.persistence</groupId>
+      <artifactId>hibernate-jpa-2.1-api</artifactId>
+      <version>1.0.2.Final</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git a/systests/jaxrs/src/test/resources/jaxrs_security/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs_security/WEB-INF/beans.xml
index f406f9e..4ba28c9 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_security/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_security/WEB-INF/beans.xml
@@ -59,6 +59,7 @@
     <bean id="bookstoreGenerics" class="org.apache.cxf.systest.jaxrs.security.SecureBookStoreGenerics"/>
     <security:authentication-manager>
 	    <security:authentication-provider>
+                <security:password-encoder ref="noopEncoder"/>
 	        <security:user-service>
 	            <security:user name="bob" password="bobspassword" authorities="ROLE_USER"/>
 	            <security:user name="baddy" password="baddyspassword" authorities="ROLE_USER"/>
@@ -67,5 +68,6 @@
 	        </security:user-service>
 	    </security:authentication-provider>
 	</security:authentication-manager>    
+    <bean id="noopEncoder" class="org.springframework.security.crypto.password.NoOpPasswordEncoder"/>
 </beans>
 <!-- END SNIPPET: beans -->
diff --git a/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml
index 3cb7074..2b2fcce 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml
@@ -29,7 +29,9 @@
     xmlns:jaxrs="http://cxf.apache.org/jaxrs" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:security="http://www.springframework.org/schema/security" 
+    xmlns:cxf="http://cxf.apache.org/core"
     xsi:schemaLocation=" 
+        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
         http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-4.2.xsd

         http://www.springframework.org/schema/aop  http://www.springframework.org/schema/aop/spring-aop.xsd

         http://www.springframework.org/schema/security  http://www.springframework.org/schema/security/spring-security.xsd

@@ -40,6 +42,9 @@
         <jaxrs:serviceBeans>
             <ref bean="bookstore"/>
         </jaxrs:serviceBeans>
+        <jaxrs:features>
+         <cxf:logging />
+    </jaxrs:features>
         <jaxrs:providers>
             <bean class="org.apache.cxf.systest.jaxrs.security.SecurityExceptionMapper"/>
         </jaxrs:providers>
@@ -56,11 +61,13 @@
     </security:http>
     <security:authentication-manager>
 	    <security:authentication-provider>
+                <security:password-encoder ref="noopEncoder"/>
 	        <security:user-service>
 	            <security:user name="bob" password="bobspassword" authorities="ROLE_USER"/>
 	            <security:user name="foo" password="bar" authorities="ROLE_USER, ROLE_ADMIN"/>
 	        </security:user-service>
 	    </security:authentication-provider>
 	</security:authentication-manager>    
+    <bean id="noopEncoder" class="org.springframework.security.crypto.password.NoOpPasswordEncoder"/>
 </beans>
 <!-- END SNIPPET: beans -->
diff --git a/systests/jaxrs/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml
b/systests/jaxrs/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml
index 807f24d..4bdf929 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml
@@ -56,11 +56,13 @@
     </security:http>
     <security:authentication-manager>
 	    <security:authentication-provider>
+                <security:password-encoder ref="noopEncoder"/>
 	        <security:user-service>
 	            <security:user name="bob" password="bobspassword" authorities="ROLE_USER"/>
 	            <security:user name="foo" password="bar" authorities="ROLE_USER, ROLE_ADMIN"/>
 	        </security:user-service>
 	    </security:authentication-provider>
 	</security:authentication-manager>    
+    <bean id="noopEncoder" class="org.springframework.security.crypto.password.NoOpPasswordEncoder"/>
 </beans>
 <!-- END SNIPPET: beans -->


Mime
View raw message