elharo opened a new issue, #272:
URL: https://github.com/apache/maven-remote-resources-plugin/issues/272

   ## Summary
   The bundle descriptor is validated with `StringUtils.split` (which collapses 
empty segments) but parsed later with `String.split(":")` (which preserves 
them), so certain malformed descriptors pass validation and then fail 
confusingly during resolution.
   
   
`src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java`
   - `validate()`: `StringUtils.split(artifactDescriptor, ":")` — line 728, 
empty tokens removed, so `group:artifact::type` counts as 3 tokens and passes 
the length check (3..5).
   - `downloadBundles()`: `artifactDescriptor.split(":")` — line 822, empty 
tokens kept, so `group:artifact::type` yields `[group, artifact, "", type]` and 
resolution proceeds with an empty version.
   
   ## Impact
   A descriptor such as `group:artifact::type` (missing version) passes 
`validate()` with a clear message never shown, then fails later with a 
confusing version/resolution error. Also in the reactor lookup, 
`s[0].equals(p.getGroupId())` can throw if `p.getGroupId()` is null.
   
   ## Suggested fix
   Use the same splitting logic in both methods (and ideally a single parser 
that also checks that groupId/artifactId/version are non-empty), and null-guard 
the reactor comparison.


-- 
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