提交 c269a60a 编写于 作者: S shenhongxi

引入dubbo-demo-consumer.xml

上级 a763fe1b
......@@ -3,7 +3,7 @@
mvn clean package -DskipTests <br />
得到的jar包中的MANIFEST.MF其中几行: <br />
Main-Class: org.springframework.boot.loader.JarLauncher <br />
Start-Class: com.itlong.whatsmars.spring.boot.Application <br />
Start-Class: com.itlong.whatsmars.spring.boot.App <br />
Spring-Boot-Classes: BOOT-INF/classes/ <br />
Spring-Boot-Lib: BOOT-INF/lib/ <br />
......
......@@ -12,7 +12,7 @@
<properties>
<!-- The main class to start by executing java -jar -->
<start-class>com.itlong.whatsmars.spring.boot.Application</start-class>
<start-class>com.itlong.whatsmars.spring.boot.App</start-class>
</properties>
<parent>
......
......@@ -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
......@@ -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 {
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2011 Alibaba Group.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the 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:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- 提供方应用信息,用于计算依赖关系 -->
<!--<dubbo:application name="whatsmars_consumer" />-->
<!-- 使用zookeeper注册中心暴露服务地址 -->
<!--<dubbo:registry address="zookeeper://127.0.0.1:2181" />-->
<!--<dubbo:reference id="demoService" interface="com.itlong.whatsmars.dubbo.demo.DemoService" />-->
<!--<dubbo:reference id="userService" interface="com.itlong.whatsmars.dubbo.demo.UserService" />-->
</beans>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册