整个项目依赖项如下所示:
- parent
  - child-a
    - pom.xml
  - child-b
    - src.main.java.resources
      - mybatis-generator.xml
    - pom.xml
  - pom.xml
父级,pom.xml
<project>
  <packaging>pom</packaging>
  <modules>
    <module>child-a</module>
    <module>child-b</module>
  </modules>
</project>
孩子-b,pom.xml
<project>
  <packaging>jar</packaging>
  <parent>
    <artifactId>parent</artifactId>
    <relativePath>../</relativePath>
  </parent>
  <dependencies>
    <dependency>
      <artifactId>child-a</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.mybatis.generator</groupId>
        <artifactId>mybatis-generator-maven-plugin</artifactId>
        <!-- other configs -->
      </plugin>
    </plugins>
  </build>
</project>
单独打包 child-b 项目/模块时,所有依赖项都得到了正确处理(child-a 已按预期导入)。
问题:
当我尝试mvn mybatis-generator:generate在以下目录中运行时child-b:
Error: Failed to execute goal on project service_a: Could not resolve dependencies for project xx.xx.child-b:jar:1.0-SNAPSHOT: Could not find artifact xx.xx.child-a:jar:1.0-SNAPSHOT -> [Help 1]