Repository navigation
Do not take the URL of a model in a JAR for a file path in plugin validation messages (fix #10719) - #13576
Closed
arturobernalg wants to merge 1 commit into
Closed
Do not take the URL of a model in a JAR for a file path in plugin validation messages (fix #10719)#13576arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
…g plugin validation issues (fix apache#10719) The location of the super POM is the URL of a resource in a JAR, such as jar:file:/C:/maven/lib/maven-model-builder.jar!/org/apache/maven/model/pom-4.0.0.xml. It has no ://, so it was converted to a file path to print it relative to the project, which fails on Windows with an InvalidPathException and fails the build instead of printing the warning, for instance with the release-profile of the super POM. Fixes apache#10719
Member
release-profile in the super POM is also removed from 3.10.x |
Member
Author
|
Thanks. I checked the super POM of 3.10.x: after #11999 it has no profiles and no plugins, so the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
DefaultPluginValidationManager#pluginDeclarationprints where a plugin is declared. The location of the super POM is the URL of a resource in a JAR, for instancejar:file:/C:/maven/lib/maven-model-builder.jar!/org/apache/maven/model/pom-4.0.0.xml. The existing check only treats a location as a URL when it contains://, which this one does not, so it was converted to a file path to be printed relative to the project. On Windows that throws anInvalidPathException(illegal:), and the build fails instead of printing the validation warning, as reported for therelease-profileof the super POM (#10719).How
A location with a URL scheme is printed as it is. A new
isUrlhelper recognises a scheme of at least two characters, so that the drive of a Windows path such asC:\\proj\\pom.xmlis not taken for one.Tests
DefaultPluginValidationManagerTestcovers URL and file path locations, including Windows paths.maven-corepasses (422 tests) and spotless is clean. I did not reproduce the exception end to end, because it only happens on Windows, and I did not run the integration tests.This is 3.10.x only. Maven 4 no longer has a
release-profilein the super POM.To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following: