arturobernalg opened a new pull request, #13576:
URL: https://github.com/apache/maven/pull/13576

   ## What and why
   
   `DefaultPluginValidationManager#pluginDeclaration` prints where a plugin is 
declared. The location of the super POM is the URL of a resource in a JAR, for 
instance 
`jar: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 an `InvalidPathException` 
(illegal `:`), and the build fails instead of printing the validation warning, 
as reported for the `release-profile` of the super POM (#10719).
   
   ## How
   
   A location with a URL scheme is printed as it is. A new `isUrl` helper 
recognises a scheme of at least two characters, so that the drive of a Windows 
path such as `C:\\proj\\pom.xml` is not taken for one.
   
   ## Tests
   
   `DefaultPluginValidationManagerTest` covers URL and file path locations, 
including Windows paths. `maven-core` passes (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-profile` in the super 
POM.
   
   ---
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](https://www.apache.org/licenses/LICENSE-2.0)
   check one of the following:
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [x] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to