【青橙商城-管理后台开发】2. 商品服务模块搭建
1. 服务层模块-商品
pom.xml
<dependencies> <dependency> <groupId>com.qingcheng</groupId> <artifactId>qingcheng_interface</artifactId> <version>1.0‐SNAPSHOT</version> </dependency> <dependency> <groupId>com.qingcheng</groupId> <artifactId>qingcheng_common_service</artifactId> <version>1.0‐SNAPSHOT</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7‐maven‐plugin</artifactId> <configuration> <!‐‐ 指定端口 ‐‐> <port>9001</port> <!‐‐ 请求路径 ‐‐> <path>/</path> </configuration> </plugin> </plugins> </build>
创建webapp/WEB-INF/web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <!-- 加载spring容器 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
resources下创建dubbo.properties
dubbo.port=20881 dubbo.application=goods
resources下创建db.properties
jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306/qingcheng_goods?characterEncoding=UTF8 jdbc.username=root jdbc.password=123456