maven聚合工程如何互相引用

图片说明
如图: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/> &lt;!&ndash; lookup parent from repository &ndash;&gt;-->
    </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>
0

3个回答

没有正确答案,目前还无法解决

0
0
wild84
wild84 帮忙看下如何解决这个问题?
10 个月之前 回复

提供一下UserService模块中的pom.xml内容?检查依赖写法是否正确

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!