kratos0718 opened a new pull request, #424:
URL: https://github.com/apache/maven-help-plugin/pull/424

   Fixes #393.
   
   `getAetherArtifact()` filled in a missing version from 
`org.apache.maven.artifact.Artifact.LATEST_VERSION`, which Maven 4 deprecates. 
That import was the only use of the class, so it goes too. The value stays 
`"LATEST"`, now a private constant on the mojo.
   
   One thing on the issue's suggested replacement: null does not work here. 
Aether normalises it to the empty string, not to a metaversion.
   
   ```java
   new DefaultArtifact("g", "a", "jar", (String) null).getVersion()   // ""
   new DefaultArtifact("g", "a", "jar", "LATEST").getVersion()        // 
"LATEST"
   ```
   
   (checked against maven-resolver-api 2.0.21). The result goes straight into 
`readArtifactDescriptor` and `resolveArtifact`, so an empty version would make 
`help:effective-pom -Dartifact=groupId:artifactId` look for `g:a:pom:` instead 
of the newest release.
   
   `getAetherArtifact` had no tests, so this adds four covering the two-part 
and three-part forms and the two rejection paths. The metaversion assertion 
uses the literal rather than the constant, so it still fails if the value 
changes. `mvn test` is 30 passing, spotless clean.
   


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