Skip to content

[MINOR][BUILD] Pom compiler source target#48312

Closed
EnricoMi wants to merge 1 commit intoapache:masterfrom
G-Research-Forks:pom-compiler-source-target
Closed

[MINOR][BUILD] Pom compiler source target#48312
EnricoMi wants to merge 1 commit intoapache:masterfrom
G-Research-Forks:pom-compiler-source-target

Conversation

@EnricoMi
Copy link
Copy Markdown
Contributor

@EnricoMi EnricoMi commented Oct 1, 2024

What changes were proposed in this pull request?

Add maven.compiler.source and maven.compiler.target properties to parent pom.xml.

Why are the changes needed?

But IntelliJ IDEA IDE cannot compile Spark sources without this:

error: release version 6 not supported

Language level is invalid or missing in pom.xml. Current project JDK is 17. Specify language level in Spark Project Tags

Property maven.compiler.release exists already, but does not seem to be sufficient.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Local build with IntelliJ IDEA IDE.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the BUILD label Oct 1, 2024
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Oct 2, 2024

I have no issues with IntelliJ IDEA 2024.2.3, btw, have you checked this?

image

@EnricoMi
Copy link
Copy Markdown
Contributor Author

EnricoMi commented Oct 2, 2024

With an older version of IntelliJ it looks like this:
grafik

The --release option is enabled but the target bytecode versions differ from you screenshot.

With latest IntelliJ they look like in your screenshot.

Do the suggested properties in pom.xml do any harm? Other build environments might also benefit from this. The error is quite opaque.

Or shall we rather document the minimum IntelliJ version somewhere?

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Oct 2, 2024

Do the suggested properties in pom.xml do any harm?

I'm not sure about that. cc @LuciferYang

@LuciferYang
Copy link
Copy Markdown
Contributor

No harm. Given the current Java version and relevant plugins in use, maven.compiler.release has higher priority than maven.compiler.source + maven.compiler.target, so even if they are configured, they should have no effect on the Maven build. However, IIRC IntelliJ IDEA has been able to correctly recognize the maven.compiler.release compilation parameter since version 2019.1, hasn't it?

@EnricoMi
Copy link
Copy Markdown
Contributor Author

EnricoMi commented Oct 2, 2024

I am using IntelliJ IDEA 2021.2 (Community Edition), which does not work without this fix.

@github-actions
Copy link
Copy Markdown

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jan 11, 2025
@github-actions github-actions bot closed this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants