如图:mall-web和user-manager都是继承mall-parent,userdao和userservice都时user-manager的子模块,现在userservice调用userdao时在pom里面引入依赖userdao就行了,但是mall-web就无法引用userservice,因为controller在mall-web里面。mall-web的pom如下:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.weixinmall</groupId>
<artifactId>mall-web</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mall-web</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>com.weixinmall</groupId>
<artifactId>mall-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<!--<relativePath/> <!– lookup parent from repository –>-->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.weixinmall</groupId>
<artifactId>UserService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>