Skip to content

HDDS-16001. Add missing sections in pom.xml files to fix invalid testCompile configurations in IntelliJ. - #10880

Open
ptlrs wants to merge 1 commit into
apache:masterfrom
ptlrs:HDDS-16001-Intellij-run-configrations-are-invalid
Open

HDDS-16001. Add missing sections in pom.xml files to fix invalid testCompile configurations in IntelliJ.#10880
ptlrs wants to merge 1 commit into
apache:masterfrom
ptlrs:HDDS-16001-Intellij-run-configrations-are-invalid

Conversation

@ptlrs

@ptlrs ptlrs commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The run configurations in Intellij are invalid. This can be seen from the little red cross marks on the run configurations. The error says that the class in the run configuration doesn't exist in the class path.

Since Intellij 2025.1 release, the way Intellij processes pom files has changed. It creates separate .main and .test modules in Maven projects.

See https://youtrack.jetbrains.com/projects/IDEA/issues/IDEA-371535/Confusing-separate-.main-and-.test-modules-in-Maven-projects

If there is a difference between the main and test configurations, then Intellij will create separate main and test modules. As such the default classpath won't work. The run configurations are pointing to classes which are not in the default classpath but instead in the classpath with the .main suffix. 

This PR adds a default-testCompile for the test sections to bring them on par with the main configurations. After this Intellij doesn't split the module into main and test and the existing run configurations become valid again.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16001

How was this patch tested?

Tested locally
CI: https://github.com/ptlrs/ozone/actions/runs/30307554649

…les to fix invalid testCompile configurations in IntelliJ.

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @ptlrs for the patch. run config fix looks good, but the pom changes should be avoided.

Comment thread pom.xml
Comment on lines +1844 to +1854
<execution>
<id>default-testCompile</id>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<compilerArgs>
<arg>-AartifactId=${project.artifactId}</arg>
</compilerArgs>
</configuration>
</execution>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These testCompile configurations cause warnings, please don't add them. See HDDS-14789.

[INFO] --- compiler:3.15.0:testCompile (default-testCompile) @ hdds-cli-common ---
...
[WARNING] The following options were not recognized by any processor: '[project]'

[INFO] --- compiler:3.15.0:testCompile (default-testCompile) @ hdds-client ---
...
[WARNING] The following options were not recognized by any processor: '[artifactId]'

Comment thread .run/ScmRoles.run.xml
<configuration default="false" name="ScmRoles" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.apache.hadoop.ozone.admin.OzoneAdmin" />
<module name="ozone-tools" />
<module name="ozone-cli-admin" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is also included in #10881.

<configuration default="false" name="FreonStandalone" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.apache.hadoop.ozone.freon.Freon" />
<module name="ozone-tools" />
<module name="ozone-freon" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is missing from #10881.

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.

2 participants