“Non-resolvable parent POM: Could not transfer artifact” when trying to refer to a parent pom from a child pom with ${parent.groupid}

后端 未结 4 1374
南方客
南方客 2021-02-12 20:40

I\'m following a tutorial for maven. I have a very simple project with a couple of modules inside. On the module pom I want to reference the main proyect pom version and group t

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 20:58

    Looks like you're trying to both inherit the groupId from the parent, and simultaneously specify the parent using an inherited groupId!

    In the child pom, use something like this:

    4.0.0
    
    
      org.felipe
      tutorial_maven
      1.0-SNAPSHOT
      ../pom.xml
    
    
    tutorial_maven_jar
    

    Using properties like ${project.groupId} won't work there. If you specify the parent in this way, then you can inherit the groupId and version in the child pom. Hence, you only need to specify the artifactId in the child pom.

提交回复
热议问题