cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [04/48] cxf git commit: [CXF-6869] Applying the last part of the patch from Vedran but with a property condition as agreed and also updating a scan demo
Date Wed, 29 Jun 2016 22:44:02 GMT
[CXF-6869] Applying the last part of the patch from Vedran but with a property condition as
agreed and also updating a scan demo


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/32a37d02
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/32a37d02
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/32a37d02

Branch: refs/heads/master-jaxrs-2.1
Commit: 32a37d0230c2194a805ad391c1b6bf6d15ca242b
Parents: 7fe5982
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 8 13:49:31 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 8 13:49:31 2016 +0100

----------------------------------------------------------------------
 .../sample/rs/service/SampleScanRestApplication.java    |  4 ----
 .../src/main/resources/application.properties           |  4 +++-
 integration/spring-boot/autoconfigure/pom.xml           |  6 ++++++
 .../spring/boot/autoconfigure/CxfAutoConfiguration.java | 12 ++++++++++++
 4 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/32a37d02/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java
b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java
index 9f79c23..0ddf526 100644
--- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java
+++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java
@@ -17,7 +17,6 @@
  * under the License.
  */
 package sample.rs.service;
-import org.apache.cxf.jaxrs.spring.SpringComponentScanServer;
 import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -26,7 +25,6 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Import;
 
 @SpringBootApplication
-@Import(SpringComponentScanServer.class)
 public class SampleScanRestApplication {
     public static void main(String[] args) {
         SpringApplication.run(SampleScanRestApplication.class, args);
@@ -34,8 +32,6 @@ public class SampleScanRestApplication {
  
     @Bean
     public Swagger2Feature swaggerFeature(ApplicationContext context) {
-        // Or create a simple Swagger2Feature @Component-annotated extension
-        // and drop this method if a default feature setup is OK
         return new Swagger2Feature();
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/32a37d02/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties
b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties
index 27c5c26..091a7ac 100644
--- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties
+++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties
@@ -1 +1,3 @@
-cxf.path=/services/helloservice
\ No newline at end of file
+cxf.path=/services/helloservice
+cxf.jaxrs.component-scan=true
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/32a37d02/integration/spring-boot/autoconfigure/pom.xml
----------------------------------------------------------------------
diff --git a/integration/spring-boot/autoconfigure/pom.xml b/integration/spring-boot/autoconfigure/pom.xml
index 942fee8..cd904ff 100644
--- a/integration/spring-boot/autoconfigure/pom.xml
+++ b/integration/spring-boot/autoconfigure/pom.xml
@@ -51,6 +51,12 @@
             <optional>true</optional>
         </dependency>
         <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>${project.version}</version>
+            <optional>true</optional>
+        </dependency> 
+        <dependency>
             <groupId>${cxf.servlet-api.group}</groupId>
             <artifactId>${cxf.servlet-api.artifact}</artifactId>
             <version>${cxf.servlet-api.version}</version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/32a37d02/integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfiguration.java
b/integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfiguration.java
index 84be88f..2c48cfc 100644
--- a/integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfiguration.java
+++ b/integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfiguration.java
@@ -21,17 +21,21 @@ package org.apache.cxf.spring.boot.autoconfigure;
 import java.util.Map;
 
 import org.apache.cxf.bus.spring.SpringBus;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.spring.SpringComponentScanServer;
 import org.apache.cxf.transport.servlet.CXFServlet;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
 import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
 import org.springframework.boot.context.embedded.ServletRegistrationBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
 import org.springframework.context.annotation.ImportResource;
 
 /**
@@ -70,5 +74,13 @@ public class CxfAutoConfiguration {
     protected static class SpringBusConfiguration {
 
     }
+    
+    @Configuration
+    @ConditionalOnClass(JAXRSServerFactoryBean.class)
+    @ConditionalOnProperty(prefix = "cxf", name = "jaxrs.component-scan", havingValue = "true")
+    @Import(SpringComponentScanServer.class)
+    protected static class JaxRsConfiguration {
+     
+    }
 
 }


Mime
View raw message