Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of maven.top-level-basedir property and updated docs #17351

Merged
merged 1 commit into from
May 25, 2021

Conversation

aloubyansky
Copy link
Member

Fixes #17231

I am not sure whether I should add this property to the project generation templates.

@aloubyansky aloubyansky requested a review from famod May 19, 2021 11:07
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation labels May 19, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building f4a7b84

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 3997354

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Reclaim Disk Space ⚠️ Check → Logs Raw logs

@famod
Copy link
Member

famod commented May 19, 2021

I will have to take a close look later, but have you considered maven.multiModuleProjectDirectory? This requires a toplevel .mvn directory, though.

@aloubyansky
Copy link
Member Author

@gsmet gsmet changed the title Introduction of mavem.top-level-basedir property and updated docs Introduction of maven.top-level-basedir property and updated docs May 19, 2021
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Spotted a couple of minor things.

docs/src/main/asciidoc/maven-tooling.adoc Outdated Show resolved Hide resolved
docs/src/main/asciidoc/maven-tooling.adoc Outdated Show resolved Hide resolved
if (config.rootProjectDir == null) {
final String topLevelBaseDirStr = PropertyUtils.getProperty(MAVEN_TOP_LEVEL_PROJECT_BASEDIR);
final Path tmp = topLevelBaseDirStr == null ? null : Paths.get(topLevelBaseDirStr);
this.rootProjectDir = tmp == null || !Files.exists(tmp) ? null : tmp;
Copy link
Member

Choose a reason for hiding this comment

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

This is quite convoluted.

Shouldn't we just check if it's defined and if so throw an error if it doesn't exist?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. Done.

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 90fa969

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Set up job ⚠️ Check → Logs Raw logs
Attach pull request number Set up job ⚠️ Check → Logs Raw logs
CI Sanity Check ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building cb25232

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

<maven.home>${maven.hom}</maven.home> <1>
<maven.repo.local>${settings.localRepository}</maven.repo.local> <2>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings> <3>
<maven.top-level-basedir>${session.topLevelProject.basedir.absolutePath}</maven.top-level-basedir> <4>
Copy link
Member

@famod famod May 19, 2021

Choose a reason for hiding this comment

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

Doesn't seem to provide the correct dir when used with -f:

$ mvn -f integration-tests/flyway/ help:evaluate -Dexpression=session.topLevelProject.basedir.absolutePath -q -DforceStdout
/home/famod/proj/quarkus/integration-tests/flyway
$ mvn -f integration-tests/flyway/ help:evaluate -Dexpression=maven.multiModuleProjectDirectory -q -DforceStdout
/home/famod/proj/quarkus

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, that's what Maven reports as the top-level project. Right?

Copy link
Member Author

Choose a reason for hiding this comment

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

When you use -f that's what you are asking for, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

But I also see your point.

Copy link
Member Author

Choose a reason for hiding this comment

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

If I use the reproducer from the original report, either property works. So, I'm wondering whether maven.multiModuleProjectDirectory is a better choice.

Copy link
Member

@famod famod May 19, 2021

Choose a reason for hiding this comment

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

AFAIK, maven.multiModuleProjectDirectory is not really documented. And it seems some Maven maintainers don't like users taking advantage of it:
https://lists.apache.org/thread.html/re9419b4792bd324eac4bbe5a5d21c11800b33c8d8fb2dfdf3eb55b28%40%3Cusers.maven.apache.org%3E

Copy link
Member

Choose a reason for hiding this comment

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

PS: Link fixed ⬆️.
PPS: I use that property in my projects regardless of that controversy. 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note that it's not an officially supported property.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah ok. I mean it's out there, people are using it, for good reasons!
But to be on the safe side for a big public framework like Quarkus, this defensive approach makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @famod

docs/src/main/asciidoc/maven-tooling.adoc Outdated Show resolved Hide resolved
@aloubyansky aloubyansky force-pushed the maven.top-level-basedir branch 2 times, most recently from 561b2d9 to db9dbac Compare May 19, 2021 20:32
@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 561b2d9

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Devtools Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Devtools Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 16 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
MicroProfile TCKs Tests Verify ⚠️ Check → Logs Raw logs
Native Tests - Amazon ⚠️ Check → Logs Raw logs
Native Tests - Cache ⚠️ Check → Logs Raw logs
Native Tests - Data1 Build ⚠️ Check → Logs Raw logs
Native Tests - Data2 Build ⚠️ Check → Logs Raw logs
Native Tests - Data3 Build ⚠️ Check → Logs Raw logs
Native Tests - Data4 Build ⚠️ Check → Logs Raw logs
Native Tests - Data5 Build ⚠️ Check → Logs Raw logs
Native Tests - Data6 Build ⚠️ Check → Logs Raw logs
Native Tests - Data7 Build ⚠️ Check → Logs Raw logs
Native Tests - HTTP ⚠️ Check → Logs Raw logs
Native Tests - Main Build ⚠️ Check → Logs Raw logs
Native Tests - Messaging1 ⚠️ Check → Logs Raw logs
Native Tests - Messaging2 ⚠️ Check → Logs Raw logs
Native Tests - Misc1 ⚠️ Check → Logs Raw logs
Native Tests - Misc2 ⚠️ Check → Logs Raw logs
Native Tests - Misc3 ⚠️ Check → Logs Raw logs
Native Tests - Misc4 ⚠️ Check → Logs Raw logs
Native Tests - Security1 ⚠️ Check → Logs Raw logs
Native Tests - Security2 ⚠️ Check → Logs Raw logs
Native Tests - Security3 ⚠️ Check → Logs Raw logs
Native Tests - Spring ⚠️ Check → Logs Raw logs
Native Tests - Windows - hibernate-validator ⚠️ Check → Logs Raw logs
Native Tests - gRPC ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building db9dbac

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@famod
Copy link
Member

famod commented May 19, 2021

My opinion on:

I am not sure whether I should add this property to the project generation templates.

I wouldn't do it because:

  • session.topLevelProject.basedir.absolutePath doesn't work for -f in "standard setups" (where the bootstrapping doesn't have issues anyway).
  • maven.multiModuleProjectDirectory requires .mvn (which many might have anyway, but it's no must).

So, IMO, if someone with a more "exotic" setup runs into problems he or she can have a look at the docs you've just extended and pick one of the properties. If I were that person I would go for maven.multiModuleProjectDirectory because it works for more scenarios.

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building fcbd71a

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Devtools Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Devtools Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 16 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
MicroProfile TCKs Tests Verify ⚠️ Check → Logs Raw logs
Native Tests - Amazon ⚠️ Check → Logs Raw logs
Native Tests - Cache ⚠️ Check → Logs Raw logs
Native Tests - Data1 Build ⚠️ Check → Logs Raw logs
Native Tests - Data2 Build ⚠️ Check → Logs Raw logs
Native Tests - Data3 Build ⚠️ Check → Logs Raw logs
Native Tests - Data4 Build ⚠️ Check → Logs Raw logs
Native Tests - Data5 Build ⚠️ Check → Logs Raw logs
Native Tests - Data6 Build ⚠️ Check → Logs Raw logs
Native Tests - Data7 Build ⚠️ Check → Logs Raw logs
Native Tests - HTTP ⚠️ Check → Logs Raw logs
Native Tests - Main Build ⚠️ Check → Logs Raw logs
Native Tests - Messaging1 ⚠️ Check → Logs Raw logs
Native Tests - Messaging2 ⚠️ Check → Logs Raw logs
Native Tests - Misc1 ⚠️ Check → Logs Raw logs
Native Tests - Misc2 ⚠️ Check → Logs Raw logs
Native Tests - Misc3 ⚠️ Check → Logs Raw logs
Native Tests - Misc4 ⚠️ Check → Logs Raw logs
Native Tests - Security1 ⚠️ Check → Logs Raw logs
Native Tests - Security2 ⚠️ Check → Logs Raw logs
Native Tests - Security3 ⚠️ Check → Logs Raw logs
Native Tests - Spring ⚠️ Check → Logs Raw logs
Native Tests - Windows - hibernate-validator ⚠️ Check → Logs Raw logs
Native Tests - gRPC ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 03c7e3c

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Calculate Test Jobs Run actions/checkout@v2 ⚠️ Check → Logs Raw logs

@aloubyansky
Copy link
Member Author

@gsmet is this looking ok to you?

@gsmet
Copy link
Member

gsmet commented May 25, 2021

I'm happy @famod had a closer look. I'll merge it to get in into CR1.

@gsmet gsmet merged commit 8890df7 into quarkusio:main May 25, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation
Projects
None yet
3 participants