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:30:00 UTC
[jira] [Updated] (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:all-tabpanel ]
Robert Scholte updated MNG-6503:
--------------------------------
Description:
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]
was:
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:
mvntst <- top folder
parent <- subfolder having parent pom
subproj <- subfolder having a sub project
The 3 folders have a pom.xml:
in mvntst folder (the top level folder)
<?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>
in parent subfolder:
<?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>
in subproj subfolder:
<?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>
In doing various tests: if the top pom is missing its relative-path, you get an
expected
Non-resolvable parent POM for mvntst:top:[unknown-version]: Failure to find
mvntst:parent:pom:1.0.0 ...
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:
Non-resolvable parent POM for mvntst:subproj:[unknown-version]: Failure to find
mvntst:parent:pom:1.0.0
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]
> 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)