You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2018/11/01 17:31:00 UTC

[jira] [Commented] (MNG-6503) parent pom relative path regression after 3.3.9

    [ https://issues.apache.org/jira/browse/MNG-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16671911#comment-16671911 ] 

Robert Scholte commented on MNG-6503:
-------------------------------------

Duplicate of MNG-6261?

> parent pom relative path regression after 3.3.9
> -----------------------------------------------
>
>                 Key: MNG-6503
>                 URL: https://issues.apache.org/jira/browse/MNG-6503
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.4, 3.6.0
>         Environment: Windows 10, Java 8, fails with maven 3.5.4 and 3.6.0, works with 3.3.9
>            Reporter: Marshall Schor
>            Priority: Major
>
> Used to work in 3.3.9.  Failure to resolve parent-pom via relative-path in some cases.
>   
>  A trivial example, with the folder structure and the poms. You
>  can see the failure by typing mvn help:effective-pom after cd'ing to the top
>  project's folder.
> Here's the folder structure:
> {noformat}
>  mvntst <- top folder
>     parent  <- subfolder having parent pom
>     subproj <- subfolder having a sub project
> {noformat}
> The 3 folders have a pom.xml:
> in mvntst folder (the top level folder)
> {code:xml}
> <?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>mvntst</groupId>
>      <artifactId>top</artifactId>
>      <packaging>pom</packaging>
>      <parent>
>          <groupId>mvntst</groupId>
>          <artifactId>parent</artifactId>
>          <version>1.0.0</version>
>          <relativePath>parent/pom.xml</relativePath>   <!-- works, finds the
>  parent -->
>      </parent>
>      <modules>
>        <module>subproj</module>
>      </modules>
>  </project>
> {code}
> in parent subfolder:
> {code:xml}
> <?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>mvntst</groupId>
>      <artifactId>parent</artifactId>
>      <version>1.0.0</version>
>      <packaging>pom</packaging>
>  </project>
> {code}
> in subproj subfolder:
> {code:xml}
> <?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>mvntst</groupId>
>      <artifactId>subproj</artifactId>
>      <parent>
>          <groupId>mvntst</groupId>
>          <artifactId>parent</artifactId>
>          <version>1.0.0</version>
>          <relativePath>../parent/pom.xml</relativePath>  <!-- fails -->  
>      </parent>
>  </project>
> {code}
> In doing various tests: if the top pom is missing its relative-path, you get an
>  expected
> {noformat}Non-resolvable parent POM for mvntst:top:[unknown-version]: Failure to find
>  mvntst:parent:pom:1.0.0 ...{noformat}
> putting in the relative-path into the top fixes this, and results in finding the
>  parent for the top level.
>  If you don't have a <modules> section in the top level, the mvn
>  {{help:effective-pom}} works OK.
> Putting in the <modules> section gives the error:
>  {noformat}Non-resolvable parent POM for mvntst:subproj:[unknown-version]: Failure to find
>  mvntst:parent:pom:1.0.0{noformat}
> Adding the <version> to the artifact IDs for the top and subproj doesn't help,
>  except to change the error message to include the version instead of
>  [unknown-version]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)