adangel commented on code in PR #1128:
URL: https://github.com/apache/maven/pull/1128#discussion_r1206411840


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginValidationManager.java:
##########
@@ -247,7 +247,11 @@ private String pluginOccurrence(MavenSession mavenSession) 
{
         File currentPom = prj.getFile();
         if (currentPom != null) {
             File rootBasedir = mavenSession.getTopLevelProject().getBasedir();
-            result += " (" + 
rootBasedir.toPath().relativize(currentPom.toPath()) + ")";
+            if (currentPom.getPath().startsWith(rootBasedir.getPath())) {

Review Comment:
   I've refactored the parts using your ideas (determine the relative path 
first before adding to the result string). The commits should probably be 
squashed before merged.
   
   I've changed it also for `pluginDeclaration()`, to have consistent behavior.
   
   Open question is now: Should I use 
`session.getRequest().getMultiModuleProjectDirectory().toPath()` instead of 
`mavenSession.getTopLevelProject().getBasedir().toPath()` for the root 
directory (for both pluginDeclaration() and pluginOccurrence()?
   



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