[jira] [Updated] (MNG-6262) getCanonicalFile() is not used consistently during project resolution
[ https://issues.apache.org/jira/browse/MNG-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylwester Lachiewicz updated MNG-6262: -- Fix Version/s: (was: 3.x / Backlog) 3.6.x-candidate > getCanonicalFile() is not used consistently during project resolution > - > > Key: MNG-6262 > URL: https://issues.apache.org/jira/browse/MNG-6262 > Project: Maven > Issue Type: Bug > Components: core, Reactor and workspace >Affects Versions: 3.0-alpha-1, 3.5.0 > Environment: Windows 7 >Reporter: Gene Smith >Priority: Minor > Fix For: 3.6.x-candidate > > Attachments: test-inconsistent-canonicalization.zip > > > This bug manifests with... > * maven 3.5.0 *AND WITH* maven built from 3.5.1's unreleased sources > * on Windows 7 when the "Drive Letter" is configured with the wrong case. > * in projects which descend from a pom which does not reference them. > On Windows getCanonicalFile() is used on module File objects before they > are wrapped in a FileSource and cached. But DefaultModelBuilder compares > its cache hits against a File which has not been made cananonical. > Normally it does not matter on Windows, because the lack of symbolic links > makes it difficult to find an "Absolute File" which is not the same as its > "Canonical File", but there is at least one use case it happens in... > If invoking scripts use a "lower case drive letter" (ex: c:\, d:\, etc...) > then the "Canonical File" has an "upper case drive letter". > The error only seems to occur if a POM references a parent which does not list > the referencing POM as a child. In other words, when there is POM inheritance > without a reactor module relationship. In my use case there is a Dependency > Management POM which does not reference all the modules which list it as their > parent. > A simple work around is... > Make sure all your Windows Environments have capital drive letters in the > Jenkins node configuration, and scripting. > .. > {noformat} > Testing from sources: > https://git-wip-us.apache.org/repos/asf/maven.git > origin/master > b10025751 (HEAD -> master, origin/master, origin/MNG-5457_2, > origin/HEAD) [MNG-5457] Show repository id when downloading or uploading > from/to a remote repository > https://git-wip-us.apache.org/repos/asf/maven-resolver.git > origin/master > c9212232 (HEAD -> master, origin/master, origin/HEAD) > [maven-release-plugin] prepare for next development iteration > {noformat} > I found {{DefaultModelBuilder}} compares a POM's Non-Canonical File's URI > against a > cached Model's POM's Canonical File's URI. > {code:java} > org.apache.maven.model.building.DefaultModelBuilder > File pomFile = parentData.getModel().getPomFile(); > if ( pomFile != null ) > { > ModelSource expectedParentSource = getParentPomFile( childModel, > childSource ); > if ( expectedParentSource instanceof ModelSource2 > && !pomFile.toURI().equals( ( (ModelSource2) > expectedParentSource ).getLocationURI() ) ) > { > parentData = readParentExternally( childModel, request, > problems ); > } > } > {code} > Where {{ModelSource2}} is a {{org.apache.maven.building.FileSource}} which > has been > made from a canonical file. > In my test environment it composed and compared these two URIs for > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and found they did not match: > > [file:/C:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] > > [file:/c:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] > resulting in this error output: > {noformat} > [ERROR] [ERROR] Some problems were encountered while processing the POMs: > [FATAL] Non-resolvable parent POM for > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find > artifact > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and 'parent.relativePath' points at wrong local POM @ > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, > C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 > @ > [ERROR] The build could not read 1 project -> [Help 1] > org.apache.maven.project.ProjectBuildingException: Some problems were > encountered while processing the POMs: > [FATAL] Non-resolvable parent POM for > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find > artifact > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and 'parent.relativePath' points at wrong local POM @ >
[jira] [Updated] (MNG-6262) getCanonicalFile() is not used consistently during project resolution
[ https://issues.apache.org/jira/browse/MNG-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylwester Lachiewicz updated MNG-6262: -- Fix Version/s: 3.x / Backlog > getCanonicalFile() is not used consistently during project resolution > - > > Key: MNG-6262 > URL: https://issues.apache.org/jira/browse/MNG-6262 > Project: Maven > Issue Type: Bug > Components: core, Reactor and workspace >Affects Versions: 3.0-alpha-1, 3.5.0 > Environment: Windows 7 >Reporter: Gene Smith >Priority: Minor > Fix For: 3.x / Backlog > > Attachments: test-inconsistent-canonicalization.zip > > > This bug manifests with... > * maven 3.5.0 *AND WITH* maven built from 3.5.1's unreleased sources > * on Windows 7 when the "Drive Letter" is configured with the wrong case. > * in projects which descend from a pom which does not reference them. > On Windows getCanonicalFile() is used on module File objects before they > are wrapped in a FileSource and cached. But DefaultModelBuilder compares > its cache hits against a File which has not been made cananonical. > Normally it does not matter on Windows, because the lack of symbolic links > makes it difficult to find an "Absolute File" which is not the same as its > "Canonical File", but there is at least one use case it happens in... > If invoking scripts use a "lower case drive letter" (ex: c:\, d:\, etc...) > then the "Canonical File" has an "upper case drive letter". > The error only seems to occur if a POM references a parent which does not list > the referencing POM as a child. In other words, when there is POM inheritance > without a reactor module relationship. In my use case there is a Dependency > Management POM which does not reference all the modules which list it as their > parent. > A simple work around is... > Make sure all your Windows Environments have capital drive letters in the > Jenkins node configuration, and scripting. > .. > {noformat} > Testing from sources: > https://git-wip-us.apache.org/repos/asf/maven.git > origin/master > b10025751 (HEAD -> master, origin/master, origin/MNG-5457_2, > origin/HEAD) [MNG-5457] Show repository id when downloading or uploading > from/to a remote repository > https://git-wip-us.apache.org/repos/asf/maven-resolver.git > origin/master > c9212232 (HEAD -> master, origin/master, origin/HEAD) > [maven-release-plugin] prepare for next development iteration > {noformat} > I found {{DefaultModelBuilder}} compares a POM's Non-Canonical File's URI > against a > cached Model's POM's Canonical File's URI. > {code:java} > org.apache.maven.model.building.DefaultModelBuilder > File pomFile = parentData.getModel().getPomFile(); > if ( pomFile != null ) > { > ModelSource expectedParentSource = getParentPomFile( childModel, > childSource ); > if ( expectedParentSource instanceof ModelSource2 > && !pomFile.toURI().equals( ( (ModelSource2) > expectedParentSource ).getLocationURI() ) ) > { > parentData = readParentExternally( childModel, request, > problems ); > } > } > {code} > Where {{ModelSource2}} is a {{org.apache.maven.building.FileSource}} which > has been > made from a canonical file. > In my test environment it composed and compared these two URIs for > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and found they did not match: > > [file:/C:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] > > [file:/c:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] > resulting in this error output: > {noformat} > [ERROR] [ERROR] Some problems were encountered while processing the POMs: > [FATAL] Non-resolvable parent POM for > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find > artifact > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and 'parent.relativePath' points at wrong local POM @ > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, > C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 > @ > [ERROR] The build could not read 1 project -> [Help 1] > org.apache.maven.project.ProjectBuildingException: Some problems were > encountered while processing the POMs: > [FATAL] Non-resolvable parent POM for > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find > artifact > test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT > and 'parent.relativePath' points at wrong local POM @ > test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, >
[jira] [Updated] (MNG-6262) getCanonicalFile() is not used consistently during project resolution
[ https://issues.apache.org/jira/browse/MNG-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylwester Lachiewicz updated MNG-6262: -- Description: This bug manifests with... * maven 3.5.0 *AND WITH* maven built from 3.5.1's unreleased sources * on Windows 7 when the "Drive Letter" is configured with the wrong case. * in projects which descend from a pom which does not reference them. On Windows getCanonicalFile() is used on module File objects before they are wrapped in a FileSource and cached. But DefaultModelBuilder compares its cache hits against a File which has not been made cananonical. Normally it does not matter on Windows, because the lack of symbolic links makes it difficult to find an "Absolute File" which is not the same as its "Canonical File", but there is at least one use case it happens in... If invoking scripts use a "lower case drive letter" (ex: c:\, d:\, etc...) then the "Canonical File" has an "upper case drive letter". The error only seems to occur if a POM references a parent which does not list the referencing POM as a child. In other words, when there is POM inheritance without a reactor module relationship. In my use case there is a Dependency Management POM which does not reference all the modules which list it as their parent. A simple work around is... Make sure all your Windows Environments have capital drive letters in the Jenkins node configuration, and scripting. .. {noformat} Testing from sources: https://git-wip-us.apache.org/repos/asf/maven.git origin/master b10025751 (HEAD -> master, origin/master, origin/MNG-5457_2, origin/HEAD) [MNG-5457] Show repository id when downloading or uploading from/to a remote repository https://git-wip-us.apache.org/repos/asf/maven-resolver.git origin/master c9212232 (HEAD -> master, origin/master, origin/HEAD) [maven-release-plugin] prepare for next development iteration {noformat} I found {{DefaultModelBuilder}} compares a POM's Non-Canonical File's URI against a cached Model's POM's Canonical File's URI. {code:java} org.apache.maven.model.building.DefaultModelBuilder File pomFile = parentData.getModel().getPomFile(); if ( pomFile != null ) { ModelSource expectedParentSource = getParentPomFile( childModel, childSource ); if ( expectedParentSource instanceof ModelSource2 && !pomFile.toURI().equals( ( (ModelSource2) expectedParentSource ).getLocationURI() ) ) { parentData = readParentExternally( childModel, request, problems ); } } {code} Where {{ModelSource2}} is a {{org.apache.maven.building.FileSource}} which has been made from a canonical file. In my test environment it composed and compared these two URIs for test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and found they did not match: [file:/C:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] [file:/c:/Jenkins/workspace/test/pom.xml|file:///C:/Jenkins/workspace/test/pom.xml] resulting in this error output: {noformat} [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find artifact test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 @ [ERROR] The build could not read 1 project -> [Help 1] org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find artifact test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:382) at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:400) at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:391) at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:78) at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:511) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:221) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) at
[jira] [Updated] (MNG-6262) getCanonicalFile() is not used consistently during project resolution
[ https://issues.apache.org/jira/browse/MNG-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Scholte updated MNG-6262: Description: This bug manifests with... * maven 3.5.0 *AND WITH* maven built from 3.5.1's unreleased sources * on Windows 7 when the "Drive Letter" is configured with the wrong case. * in projects which descend from a pom which does not reference them. On Windows getCanonicalFile() is used on module File objects before they are wrapped in a FileSource and cached. But DefaultModelBuilder compares its cache hits against a File which has not been made cananonical. Normally it does not matter on Windows, because the lack of symbolic links makes it difficult to find an "Absolute File" which is not the same as its "Canonical File", but there is at least one use case it happens in... If invoking scripts use a "lower case drive letter" (ex: c:\, d:\, etc...) then the "Canonical File" has an "upper case drive letter". The error only seems to occur if a POM references a parent which does not list the referencing POM as a child. In other words, when there is POM inheritance without a reactor module relationship. In my use case there is a Dependency Management POM which does not reference all the modules which list it as their parent. A simple work around is... Make sure all your Windows Environments have capital drive letters in the Jenkins node configuration, and scripting. .. {noformat} Testing from sources: https://git-wip-us.apache.org/repos/asf/maven.git origin/master b10025751 (HEAD -> master, origin/master, origin/MNG-5457_2, origin/HEAD) [MNG-5457] Show repository id when downloading or uploading from/to a remote repository https://git-wip-us.apache.org/repos/asf/maven-resolver.git origin/master c9212232 (HEAD -> master, origin/master, origin/HEAD) [maven-release-plugin] prepare for next development iteration {noformat} I found {{DefaultModelBuilder}} compares a POM's Non-Canonical File's URI against a cached Model's POM's Canonical File's URI. {code} org.apache.maven.model.building.DefaultModelBuilder File pomFile = parentData.getModel().getPomFile(); if ( pomFile != null ) { ModelSource expectedParentSource = getParentPomFile( childModel, childSource ); if ( expectedParentSource instanceof ModelSource2 && !pomFile.toURI().equals( ( (ModelSource2) expectedParentSource ).getLocationURI() ) ) { parentData = readParentExternally( childModel, request, problems ); } } {code} Where {{ModelSource2}} is a {{org.apache.maven.building.FileSource}} which has been made from a canonical file. In my test environment it composed and compared these two URIs for test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and found they did not match: file:/C:/Jenkins/workspace/test/pom.xml file:/c:/Jenkins/workspace/test/pom.xml resulting in this error output: {noformat} [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find artifact test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 @ [ERROR] The build could not read 1 project -> [Help 1] org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT: Could not find artifact test-inconsistent-canonicalization:dependency-management:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ test-inconsistent-canonicalization:reactor:1.0.0-SNAPSHOT, C:\Jenkins\workspace\test\reactor\pom.xml, line 5, column 11 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:382) at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:400) at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:391) at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:78) at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:511) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:221) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)