Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes f54ac6b87 -> ab4769a3b


[CXF-7482] Updating the spring_boot_scan application to use the properties file


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

Branch: refs/heads/3.1.x-fixes
Commit: ab4769a3b1116c9ac95994213264b5619d019595
Parents: f54ac6b
Author: Sergey Beryozkin <[email protected]>
Authored: Wed Aug 23 11:27:19 2017 +0100
Committer: Sergey Beryozkin <[email protected]>
Committed: Wed Aug 23 11:30:29 2017 +0100

----------------------------------------------------------------------
 .../java/sample/rs/service/SampleRestApplication.java | 14 +++++++++++++-
 .../java/sample/rs/service/SampleRestApplication.java | 14 --------------
 .../application/src/main/resources/application.yml    |  2 +-
 .../application/src/main/resources/swagger.properties |  7 +++++++
 4 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ab4769a3/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java
----------------------------------------------------------------------
diff --git 
a/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java
 
b/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java
index 358ca4a..86363f2 100644
--- 
a/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java
+++ 
b/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java
@@ -46,7 +46,19 @@ public class SampleRestApplication {
         endpoint.setBus(bus);
         endpoint.setServiceBeans(Arrays.<Object>asList(new 
HelloServiceImpl1(), new HelloServiceImpl2()));
         endpoint.setAddress("/");
-        endpoint.setFeatures(Arrays.asList(new Swagger2Feature()));
+        endpoint.setFeatures(Arrays.asList(createSwaggerFeature()));
         return endpoint.create();
     }
+
+    public Swagger2Feature createSwaggerFeature() {
+        Swagger2Feature swagger2Feature = new Swagger2Feature();
+        swagger2Feature.setPrettyPrint(true);
+        swagger2Feature.setTitle("Spring Boot CXF REST Application");
+        swagger2Feature.setContact("The Apache CXF team");
+        swagger2Feature.setDescription("This sample project demonstrates how 
to use CXF JAX-RS services"
+                + " with Spring Boot. This demo has two JAX-RS class resources 
being"
+                + " deployed in a single JAX-RS endpoint.");
+        swagger2Feature.setVersion("1.0.0");
+        return swagger2Feature;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ab4769a3/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
----------------------------------------------------------------------
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 81d2965..b929db5 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
@@ -21,7 +21,6 @@ import java.util.Collections;
 
 import com.codahale.metrics.MetricRegistry;
 
-import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics;
 import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
@@ -49,17 +48,4 @@ public class SampleRestApplication {
     public static void main(String[] args) {
         SpringApplication.run(SampleRestApplication.class, args);
     }
-
-    @Bean
-    public Swagger2Feature enhancedSwaggerDescription() {
-        Swagger2Feature swagger2Feature = new Swagger2Feature();
-        swagger2Feature.setPrettyPrint(true);
-        swagger2Feature.setTitle("Spring Boot CXF REST Scan Application");
-        swagger2Feature.setContact("The Apache CXF team");
-        swagger2Feature.setDescription("This sample project demonstrates how 
to use CXF JAX-RS services"
-                + " with Spring Boot. This demo has two JAX-RS class resources 
being auto-discovered"
-                + " and deployed in a single JAX-RS endpoint.");
-        swagger2Feature.setVersion("1.0.0");
-        return swagger2Feature;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ab4769a3/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/application.yml
----------------------------------------------------------------------
diff --git 
a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/application.yml
 
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/application.yml
index 4e6ea32..d52b3f0 100644
--- 
a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/application.yml
+++ 
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/application.yml
@@ -8,7 +8,7 @@ cxf:
     service-list-path: /info
   jaxrs:
     component-scan: true
-    classes-scan-packages: org.apache.cxf.metrics
+    classes-scan-packages: org.apache.cxf.jaxrs.swagger,org.apache.cxf.metrics
 
 eureka:
   client:

http://git-wip-us.apache.org/repos/asf/cxf/blob/ab4769a3/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/swagger.properties
----------------------------------------------------------------------
diff --git 
a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/swagger.properties
 
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/swagger.properties
new file mode 100644
index 0000000..0770699
--- /dev/null
+++ 
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/resources/swagger.properties
@@ -0,0 +1,7 @@
+title = Spring Boot CXF REST Scan Application
+description = This sample project demonstrates how to use CXF JAX-RS services \
+              with Spring Boot. This demo has two JAX-RS class resources being 
auto-discovered \
+              and deployed in a single JAX-RS endpoint.
+version = 1.0.0
+contact = The Apache CXF team
+

Reply via email to