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

maven.compiler.source & maven.compiler.target 8 #320

Closed
famod opened this issue Jan 8, 2021 · 7 comments
Closed

maven.compiler.source & maven.compiler.target 8 #320

famod opened this issue Jan 8, 2021 · 7 comments
Labels
wontfix This will not be worked on

Comments

@famod
Copy link
Contributor

famod commented Jan 8, 2021

These two properties are defined in root pom.xml, but shouldn't both be set to 11?
Furthermore, maven.compiler.release should be used instead, which also makes sure that you don't use JDK 12+ APIs.

@gnodet
Copy link
Contributor

gnodet commented Jan 8, 2021

The client is >= 11, but the server needs to be compatible with JDK 8.

@gnodet gnodet added this to the No fix/wont't fix milestone Jan 15, 2021
@gnodet gnodet closed this as completed Jan 15, 2021
@famod
Copy link
Contributor Author

famod commented Jan 15, 2021

Sorry for the late reply. My main point is that, ideally, the mvnd build process should make sure that for the Java8 parts no Java9+ API is used (or Java12+ for the Java11 parts).
I tried switching to <release>8</release> but this fails because of this Java9+ feature: https://github.com/mvndaemon/mvnd/blob/master/client/pom.xml#L94
Alternatively I could add animal-sniffer-plugin.

Is this topic of any interest @gnodet & @ppalaga?

@ppalaga
Copy link
Contributor

ppalaga commented Jan 15, 2021

I tried switching to <release>8</release> but this fails because of this Java9+ feature: https://github.com/mvndaemon/mvnd/blob/master/client/pom.xml#L94

It is in the client and as @gnodet pointed out above, client's baseline is Java 11. Other modules should be Java 8+.

My main point is that, ideally, the mvnd build process should make sure that for the Java8 parts no Java9+ API is used

Yes, some sort of verification would be nice. Is animal-sniffer-plugin reasonably fast? Running the native integration tests on Java 8 would also be fine.

(or Java12+ for the Java11 parts).

I think that's already guaranteed by the fact that we build with Java 11 on the CI. The build would fail if we used APIs from newer Java versions.

@famod
Copy link
Contributor Author

famod commented Jan 15, 2021

Is animal-sniffer-plugin reasonably fast?

I would say so. I'm using it in https://github.com/vackosar/gitflow-incremental-builder (which is a smaller project than mvnd, though). I can give it a try and post some numbers.

I think that's already guaranteed by the fact that we build with Java 11 on the CI. The build would fail if we used APIs from newer Java versions.

Yeah, right, but it's always a bit frustrating if you think you're done (locally), just to see CI failing after the push. 😉

@ppalaga
Copy link
Contributor

ppalaga commented Jan 15, 2021

it's always a bit frustrating if you think you're done (locally), just to see CI failing after the push

I'd find it more frustrating to have slow local build :)

@famod
Copy link
Contributor Author

famod commented Jan 15, 2021

I'll have a second, more detailed look at <release>...</release> and in case that doesn't work I'll give the sniffer a quicky try and report back.

@famod
Copy link
Contributor Author

famod commented Jan 17, 2021

I've given up on this for now:

  • release doesn't work in client due to:
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] exporting a package from system module java.base is not allowed with --release
    [INFO] 1 error
    
  • <release>8</release> doesn't work in daemon due to:
    package sun.misc does not exist
    
    See also: https://stackoverflow.com/a/60172333/9529981 (which suggest adding an export, which would yield the same problem as in client)
    Maybe I'm wrong, but this smells like a toolchain and/or mutli-release jar problem.
  • sniffer signatures only go as far as 1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants