crazy_kis
crazy_kis
2019-02-22 00:05

install子pom,无法找到父pom,进而导致找不到依赖jar包

5
  • spring
  • java
  • maven

项目目录结构如图:

图片说明
dal

在打包一个子项目,install 子pom时报错,如下:

[DEBUG] =======================================================================
[DEBUG] Could not find metadata com.dnt.nrc:nrc-service-root:2.0.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\hazyhao\.m2\repository)
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=58, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=30, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=13, ConflictResolver.conflictItemCount=46, DefaultDependencyCollector.collectTime=1212, DefaultDependencyCollector.transformTime=18}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.141 s
[INFO] Finished at: 2019-02-22T00:00:19+08:00
[INFO] Final Memory: 9M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project common-dal: Could not resolve dependencies for project com.dnt.nrc:common-dal:jar:2.0.0-SNAPSHOT: Failed to collect dependencies at com.dnt.nrc:common-domain:jar:2.0.0-SNAPSHOT: Failed to read artifact descriptor for com.dnt.nrc:common-domain:jar:2.0.0-SNAPSHOT: Could not find artifact com.dnt.nrc:nrc-service-root:pom:2.0.0-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project common-dal: Could not resolve dependencies for project com.dnt.nrc:common-dal:jar:2.0.0-SNAPSHOT: Failed to collect dependencies at com.dnt.nrc:common-domain:jar:2.0.0-SNAPSHOT
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:220)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)

子pom中明明指定了父pom的位置,还是找不到父pom

    <parent>
        <groupId>com.dnt.nrc</groupId>
        <artifactId>nrc-service-root</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
进而导致报错说找不到依赖jar包,

求教各位师傅,是否遇到过类似问题。
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

6条回答