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

dev mode: "option --source cannot be used together with --release" - dev mode compile doesn't collapse source/target/release options like compiler plugin does #1467

Closed
scottkurz opened this issue Mar 30, 2022 · 0 comments · Fixed by #1849
Assignees
Labels

Comments

@scottkurz
Copy link
Member

If I add the POM properties

        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.target>14</maven.compiler.target>

(ignoring whether these values really make sense or not)

and do mvn -X compile I'll get:

[DEBUG] Command line options:
[DEBUG] -d ..... -g -nowarn --release 17 -encoding UTF-8

I.e. the source + target options will be dropped and ignored and the release option will be passed to javac.

In dev mode, though, we get:

[ERROR] Error compiling Java files: error: option --source cannot be used together with --release

I'm thinking dev mode should behave more like the compiler plugin here (though I don't see this documented specifically at: https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html)

Some other references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants