[jira] [Commented] (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:comment-tabpanel=16741661#comment-16741661 ] Sylwester Lachiewicz commented on MNG-6262: --- This problem should be fixed inĀ MNG-6261 and will be included in Maven 3.6.1. If You have time, please verify version compiledĀ from our master. > 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 >Assignee: Sylwester Lachiewicz >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 >
[jira] [Commented] (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:comment-tabpanel=16515209#comment-16515209 ] Michael Osipov commented on MNG-6262: - [~rfscholte], I'd like to see Maven 4.0 to wipe {{java.io.File}} completely. Yes, this is a lot of work, but worth the effort. The Lucene project has done this too. > 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.5.0, 3.5.4-candidate > Environment: Windows 7 >Reporter: Gene Smith >Priority: Minor > 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} > 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 @ >
[jira] [Commented] (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:comment-tabpanel=16109623#comment-16109623 ] Robert Scholte commented on MNG-6262: - Maven now requires Java 7, so this is probably a good reason to switch to {{java.nio.file.Path}} at some places, as long as it doesn't break interfaces. > 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.5.0, 3.5.1-candidate > Environment: Windows 7 >Reporter: Gene Smith >Priority: Minor > 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} > 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, >
[jira] [Commented] (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:comment-tabpanel=16107117#comment-16107117 ] Dawid Weiss commented on MNG-6262: -- Related issue which compares file URIs and suffers from the same problem. Also: hard and symlinks on Windows (NTFS) definitely exist (I use them, for example), so inconsistent canonicalization or comparing by URIs is probably not a good idea. > 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.5.0, 3.5.1-candidate > Environment: Windows 7 >Reporter: Gene Smith >Priority: Minor > 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} > 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