From c269a60ae021a6873c5db8ed2ca86ba36e0c8cd0 Mon Sep 17 00:00:00 2001 From: shenhongxi Date: Wed, 28 Jun 2017 11:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5dubbo-demo-consumer.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- whatsmars-spring-boot/README.md | 2 +- whatsmars-spring-boot/pom.xml | 2 +- .../boot/{Application.java => App.java} | 5 ++- .../spring/boot/config/BeanConfig.java | 2 +- .../main/resources/dubbo-demo-consumer.xml | 31 +++++++++++++++++++ 5 files changed, 36 insertions(+), 6 deletions(-) rename whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/{Application.java => App.java} (80%) create mode 100644 whatsmars-spring-boot/src/main/resources/dubbo-demo-consumer.xml diff --git a/whatsmars-spring-boot/README.md b/whatsmars-spring-boot/README.md index 2a96f423..c94722f3 100644 --- a/whatsmars-spring-boot/README.md +++ b/whatsmars-spring-boot/README.md @@ -3,7 +3,7 @@ mvn clean package -DskipTests
得到的jar包中的MANIFEST.MF其中几行:
Main-Class: org.springframework.boot.loader.JarLauncher
-Start-Class: com.itlong.whatsmars.spring.boot.Application
+Start-Class: com.itlong.whatsmars.spring.boot.App
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
diff --git a/whatsmars-spring-boot/pom.xml b/whatsmars-spring-boot/pom.xml index 0bd60327..15bd8840 100644 --- a/whatsmars-spring-boot/pom.xml +++ b/whatsmars-spring-boot/pom.xml @@ -12,7 +12,7 @@ - com.itlong.whatsmars.spring.boot.Application + com.itlong.whatsmars.spring.boot.App diff --git a/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/Application.java b/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/App.java similarity index 80% rename from whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/Application.java rename to whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/App.java index 65888906..fa1faf2a 100644 --- a/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/Application.java +++ b/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/App.java @@ -4,17 +4,16 @@ import com.itlong.whatsmars.spring.boot.config.UserConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; @SpringBootApplication // 加上exclude=DataSource..后,不会连接数据库,同时@Mapper也不会起作用 @EnableAutoConfiguration//(exclude={DataSourceAutoConfiguration.class}) @EnableConfigurationProperties({UserConfig.class}) -public class Application { +public class App { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(App.class, args); } } \ No newline at end of file diff --git a/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/config/BeanConfig.java b/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/config/BeanConfig.java index 0e8b2de5..25411414 100644 --- a/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/config/BeanConfig.java +++ b/whatsmars-spring-boot/src/main/java/com/itlong/whatsmars/spring/boot/config/BeanConfig.java @@ -7,6 +7,6 @@ import org.springframework.context.annotation.ImportResource; * Created by shenhongxi on 2017/6/21. */ @Configuration -@ImportResource(locations={"classpath:application-bean.xml"}) +@ImportResource(locations={"classpath:dubbo-demo-consumer.xml"}) public class BeanConfig { } diff --git a/whatsmars-spring-boot/src/main/resources/dubbo-demo-consumer.xml b/whatsmars-spring-boot/src/main/resources/dubbo-demo-consumer.xml new file mode 100644 index 00000000..d4ced4f4 --- /dev/null +++ b/whatsmars-spring-boot/src/main/resources/dubbo-demo-consumer.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file -- GitLab