elharo commented on code in PR #2289:
URL: https://github.com/apache/maven/pull/2289#discussion_r2073203597


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/rootlocator/DefaultRootLocator.java:
##########
@@ -64,8 +66,14 @@ public Path findMandatoryRoot(@Nonnull Path basedir) {
             rootDirectory = rdf.orElseThrow(() -> new 
IllegalStateException(getNoRootMessage()));
             logger.warn(getNoRootMessage());
         } else {
-            if (rdf.isPresent() && !Objects.equals(rootDirectory, rdf.get())) {
-                logger.warn("Project root directory and 
multiModuleProjectDirectory are not aligned");
+            if (rdf.isPresent()) {
+                try {
+                    if (!Files.isSameFile(rootDirectory, rdf.orElseThrow())) {
+                        logger.warn("Project root directory and 
multiModuleProjectDirectory are not aligned");
+                    }
+                } catch (IOException e) {
+                    throw new UncheckedIOException("findMandatoryRoot failed", 
e);

Review Comment:
   UncheckedIOException is the wrong exception type here. Possibly this should 
return null or throw some Maven specific checked exception. Previously it threw 
IllegalStateException which is not really right either, but might be OK if this 
really "can't" happen. 



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to