项目多模块开发时,在 sdk 模块使用 server 模块的工具类编译不通过,显示 server 模块工具类所在包不存在且"找不到符号",请问这个是什么原因呢?
我已经在 sdk 模块引入了 server 模块的依赖,多模块 pom 文件内容如下:
主 pom
<groupId>demo</groupId>
<artifactId>demo1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>server</module>
<module>api</module>
<module>sdk</module>
</modules>
<dependencyManagement>
<dependency>
<groupId>demo</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>demo</groupId>
<artifactId>sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>demo</groupId>
<artifactId>server</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencyManagement>
<!--其他配置-->
sdk pom
<parent>
<groupId>demo</groupId>
<artifactId>demo1</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sdk</name>
<dependencies>
<dependency>
<groupId>demo</groupId>
<artifactId>server</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
server pom
<parent>
<groupId>demo</groupId>
<artifactId>demo1</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>server</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>server</name>
<dependencies>
<dependency>
<groupId>demo</groupId>
<artifactId>sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
sdk 和 server 模块的双向依赖的问题。