Skip to content

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented May 2, 2025

Applied proposed fix and a bit more.


https://issues.apache.org/jira/browse/MNG-8720

@cstamas cstamas requested a review from gnodet May 2, 2025 14:48
@cstamas cstamas self-assigned this May 2, 2025
@cstamas cstamas added this to the 4.0.0-rc-4 milestone May 2, 2025
return Optional.empty();
}

protected Path getCanonicalPath(Path path) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the third "incarnation" of this method 😄 so we may want to do something about it?

@cstamas cstamas marked this pull request as ready for review May 2, 2025 15:31
logger.warn("Project root directory and multiModuleProjectDirectory are not aligned");
}
} catch (IOException e) {
throw new UncheckedIOException("findMandatoryRoot failed", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findRoot ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is findMandatoryRoot method, so I don't get it why?

logger.warn("Project root directory and multiModuleProjectDirectory are not aligned");
}
} catch (IOException e) {
throw new UncheckedIOException("findMandatoryRoot failed", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cstamas
Copy link
Member Author

cstamas commented May 5, 2025

While these changes are kinda okay, I have hard to time reproduce MNG-8720.
Moreover, as I see, IF RootLocator#findRoot returns null, the user reported bug cannot happen (other branch is executing), so it MUST be the case when RootLocator#findRoot returns non-null, but alas, in that case the RootLocator#findMandatoryRoot is not even invoked..,

So am currently lost with reproducer, will merge once I figure how to reproduce. Asked user as well on issue for one.

This is only so far I got, but this PR does not fix this issue: https://gist.github.com/cstamas/3d88200e36fb60a89ba102a49ff122da

@cstamas
Copy link
Member Author

cstamas commented May 7, 2025

[cstamas@angeleyes bar (main)]$ mvn -V validate
Apache Maven 4.0.0-rc-3 (3952d00ce65df6753b63a51e86b1f626c55a8df2)
Maven home: /home/cstamas/.sdkman/candidates/maven/4.0.0-rc-3
Java version: 21.0.7, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.7-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.14.5-300.fc42.x86_64", arch: "amd64", family: "unix"
[INFO] 
[INFO] 1 problem was encountered while building the effective settings (use -e to see details)
[INFO] 
[INFO] Mimir session created with DaemonNode (socketPath=/home/cstamas/.mimir/mimir-socket; daemonPID=11582; daemonVersion=0.6.0)
[INFO] Scanning for projects...
[WARNING] Project root directory and multiModuleProjectDirectory are not aligned
[INFO] 
[INFO] -------------------------------------------------------< foo:bar >--------------------------------------------------------
[INFO] Building bar 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ pom ]----------------------------------------------------------
[INFO] Copying foo:bar:pom:0.0.1-SNAPSHOT to project local repository
[WARNING] Project root directory and multiModuleProjectDirectory are not aligned
[INFO] Copying foo:bar:pom:consumer:0.0.1-SNAPSHOT to project local repository
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.050 s
[INFO] Finished at: 2025-05-07T11:01:43+02:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Mimir session closed (RETRIEVED=0 CACHED=0)
[cstamas@angeleyes bar (main)]$

[cstamas@angeleyes bar (main)]$ mvn -V validate
Apache Maven 4.0.0-rc-4-SNAPSHOT (4ac3b14be2668ea70740dd94e486dc877b83d38a)
Maven home: /home/cstamas/Tools/maven/apache-maven-4.0.0-rc-4-SNAPSHOT
Java version: 21.0.7, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.7-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.14.5-300.fc42.x86_64", arch: "amd64", family: "unix"
[INFO] 
[INFO] 1 problem was encountered while building the effective settings (use -e to see details)
[INFO] 
[INFO] Mimir session created with DaemonNode (socketPath=/home/cstamas/.mimir/mimir-socket; daemonPID=11582; daemonVersion=0.6.0)
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------------------------------------< foo:bar >--------------------------------------------------------
[INFO] Building bar 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ pom ]----------------------------------------------------------
[INFO] Copying foo:bar:pom:0.0.1-SNAPSHOT to project local repository
[INFO] Copying foo:bar:pom:consumer:0.0.1-SNAPSHOT to project local repository
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.053 s
[INFO] Finished at: 2025-05-07T11:01:55+02:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Mimir session closed (RETRIEVED=0 CACHED=0)
[cstamas@angeleyes bar (main)]$ 

@cstamas cstamas merged commit 6be7a12 into apache:master May 7, 2025
13 checks passed
@cstamas cstamas deleted the MNG-8720 branch May 7, 2025 09:04
@Bukama Bukama added bug Something isn't working and removed maintenance labels Jun 19, 2025
@jira-importer
Copy link

Resolve #9578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants