这是我的父模块 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>io.paratek.dynalib</groupId>
<artifactId>dynalib</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>dynanode</module>
</modules>
<dependencies>
<dependency>
<groupId>io.paratek.dynalib</groupId>
<artifactId>dynanode</artifactId>
<version>1.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
这里是孩子
<?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>
<parent>
<artifactId>dynalib</artifactId>
<groupId>io.paratek.dynalib</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>dynanode</artifactId>
<version>1.1-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
正如你看到的,我的孩子有零依赖,但是,maven 正在吐出
[ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='io.paratek.dynalib:dynalib:1.0-SNAPSHOT'}' and 'Vertex{label='io.paratek.dynalib:dynanode:1.1-SNAPSHOT'}' introduces to cycle in the graph io.paratek.dynalib:dynanode:1.1-SNAPSHOT --> io.paratek.dynalib:dynalib:1.0-SNAPSHOT --> io.paratek.dynalib:dynanode:1.1-SNAPSHOT
我无法让 maven 将“dynanode”识别为“dynalib”中的依赖项。pom 文件中没有错误,但我无法在 dynalib 中使用 dynanode 函数。