Repository: cxf
Updated Branches:
  refs/heads/master 982556218 -> 905f61906


[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/905f6190
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/905f6190
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/905f6190

Branch: refs/heads/master
Commit: 905f619067931ff340536e75f0c3d196d5fd334f
Parents: 9825562
Author: Sergey Beryozkin <sberyoz...@gmail.com>
Authored: Wed Aug 23 11:27:19 2017 +0100
Committer: Sergey Beryozkin <sberyoz...@gmail.com>
Committed: Wed Aug 23 11:27:19 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/905f6190/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 0e492e9..79c8a1d 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
@@ -47,10 +47,19 @@ public class SampleRestApplication {
         endpoint.setBus(bus);
         endpoint.setServiceBeans(Arrays.<Object>asList(new 
HelloServiceImpl1(), new HelloServiceImpl2()));
         endpoint.setAddress("/");
-        Swagger2Feature swagger2Feature = new Swagger2Feature();
-        swagger2Feature.setTitle("Sample REST Application");
-        swagger2Feature.setDescription("The Application");
-        endpoint.setFeatures(Collections.singletonList(swagger2Feature));
+        
endpoint.setFeatures(Collections.singletonList(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/905f6190/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 1413b5a..1f3ff56 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;
@@ -48,17 +47,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/905f6190/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 41e2dd9..4b31362 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
@@ -10,7 +10,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/905f6190/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