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

[pom] Replaces the maven property with project property. #3919

Conversation

LinMingQiang
Copy link
Contributor

@LinMingQiang LinMingQiang commented Aug 8, 2024

Purpose

In my production environment I get compilation errors :

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.13.0:check (spotless-check) on project paimon-parent: Execution spotless-check of goal com.diffplug.spotless:spotless-maven-plugin:2.13.0:check failed: Unable to locate file with path: ${maven.multiModuleProjectDirectory}/.scalafmt.conf: Could not find resource '${maven.multiModuleProjectDirectory}/.scalafmt.conf'. -> [Help 1]

Parameter ${maven.multiModuleProjectDirectory} is not a recommended parameter. Use ${project.basedir} instead of it.

References :
https://stackoverflow.com/questions/29778262/what-is-maven-multimoduleprojectdirectory-used-for

apache/iotdb#12982

Linked issue: close #xxx

Tests

API and Format

Documentation

@LinMingQiang LinMingQiang force-pushed the master-fix-use-project-base-dir-path branch from c03b607 to 6ca2a27 Compare August 8, 2024 09:40
@Zouxxyy
Copy link
Contributor

Zouxxyy commented Aug 8, 2024

The reason why introduce ${maven.multiModuleProjectDirectory} was that some users like to cd sub-module and then execute mvn, this work well with maven 3.3.1+. ${project.basedir} may not solve this.

A better way is to replace it with ${project.rootDirectory} after maven 4.0.0, see MNG-7038 (The version is too high, so this solution is not considered)

@LinMingQiang
Copy link
Contributor Author

In this scenario, we should recommend using mvn -pl . But in many cases parameter ${maven.multiModuleProjectDirectory} would not be set , which causes the entire project to fail to compile. I think production stability is more important. WDYT.

@Zouxxyy
Copy link
Contributor

Zouxxyy commented Aug 8, 2024

In this scenario, we should recommend using mvn -pl

Agree, #3063 is just added for users who don't know how to use it (see my comment in it). Actually it can be reverted.

@Zouxxyy
Copy link
Contributor

Zouxxyy commented Aug 8, 2024

But in many cases parameter ${maven.multiModuleProjectDirectory} would not be set

Can you give more details, is maven 3.3.1- or a very high version?

@LinMingQiang
Copy link
Contributor Author

But in many cases parameter ${maven.multiModuleProjectDirectory} would not be set

Can you give more details, is maven 3.3.1- or a very high version?

My case is maven 3.2.5, this forced me to modify my pom.

@LinMingQiang
Copy link
Contributor Author

I think production stability is more important than this feature #3063, because production failure has already happened to me , WDYT.

@LinMingQiang LinMingQiang force-pushed the master-fix-use-project-base-dir-path branch from 6ca2a27 to bae4213 Compare August 9, 2024 02:06
@LinMingQiang
Copy link
Contributor Author

Revert #3063

@JingsongLi
Copy link
Contributor

What are the current issue?

Why is your compilation errors? @LinMingQiang (In my env, it is fine)

@JingsongLi
Copy link
Contributor

I think better choice is upgrade your maven version.

@JingsongLi JingsongLi closed this Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants