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

jackson-module-jaxb-annotations 2.11.2 has wrong module info (Java 9 instead of Java 11) #126

Open
oleg-nenashev opened this issue Jan 20, 2021 · 14 comments · Fixed by mojohaus/extra-enforcer-rules#158

Comments

@oleg-nenashev
Copy link

oleg-nenashev commented Jan 20, 2021

Looks like there are some minor issues in jackson-module-jaxb-annotations 2.12.1 multi-release JAR.
It looks like Java 9 - focused class is used instead. Not a big deal, but there is a warning generated by Maven Enforcer Plugin.

[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (display-info) @ MY_PROJECT ---
[INFO] Ignoring requireUpperBoundDeps in com.google.guava:guava
[INFO] Adding ignore: module-info
[WARNING] Invalid bytecodeVersion for com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.1:compile : META-INF/versions/11/module-info.class: expected 55, but was 53
@cowtowncoder
Copy link
Member

I think this is due to improvements by @GedMarc -- Java 9 is not a LTS so we probably don't care about it, but seems odd there'd be complaint by Maven enforcer plug-in. Maybe there's need to upgrade version of that plugin?

@GedMarc
Copy link
Contributor

GedMarc commented Mar 4, 2021

closable

@timja
Copy link

timja commented Apr 15, 2021

This also happens on java 11 for the record

[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (display-info) @ azure-credentials ---
[INFO] Adding ignore: module-info
Invalid bytecodeVersion for com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.2:compile : META-INF/versions/11/module-info.class: expected 55, but was 53

@cowtowncoder
Copy link
Member

If anyone has ideas of how to address that, I'm all ears. But as of now I don't know what, if anything, to do.
Seems like some verifier is expecting bytecode to be compiled targeting Java 11, but it was Java 9. Not sure why that would be considered harmful (reverse would be).

@GedMarc
Copy link
Contributor

GedMarc commented Apr 15, 2021

arg, we can move it to version/9 instead of 11

it is a setting in moditect

@GedMarc
Copy link
Contributor

GedMarc commented Apr 15, 2021

looks like an enforcer minimum jdk version setting actually -

just update enforcer to allow versions 9 and up, otherwise we'll compile module-info to version 11

@GedMarc
Copy link
Contributor

GedMarc commented Apr 15, 2021

i still feel java 9 is the right version of the module-info.class to allow for everyone,
@timja Why do have enforcer set for a minimum JDK version for items in META-INF?

@GedMarc
Copy link
Contributor

GedMarc commented Apr 15, 2021

For JDK 11 your minimum allowable java version should be 8, version 7 is no longer compilable -
For JDK 16 your minimum java version should be 9

@timja
Copy link

timja commented Apr 15, 2021

Which is what we have as far as I can tell
https://github.com/jenkinsci/plugin-pom/blob/master/pom.xml#L477

@GedMarc
Copy link
Contributor

GedMarc commented Apr 15, 2021

@cowtowncoder happy with me putting the moditect files into META-INF/versions/9 so the enforcer succeeds

It is technically correct in validating the class version with the version in the META-INF folder -
I don't believe we should try bump the class version up

@cowtowncoder
Copy link
Member

Ok so enforcer setting of which project? If it is mistaken validation by enforcer plugin outside jackson components I am not sure we should change anything.

@GedMarc
Copy link
Contributor

GedMarc commented Apr 18, 2021

Ok -
So this will probably need an issue logged in the enforcer plugin,

What is happening is for each versions, the plugin is checking for the exact version number, rather than the allowed [min.jdk,max.jdk] class files in these directories

This is specific to enforcer in the jenkins-ci pom

@GedMarc
Copy link
Contributor

GedMarc commented Jan 26, 2022

Ok @cowtowncoder

For moditect --

<plugin>...
<configuration>....
<version>9</version>

I'll start with the jakarta module base, i've spoken with the moditect guys (luke hutch), the module info must be compiled as version 9 (not 11), but for sniffers and accuracy, it should be placed under version 9 directory in META-INF, not 11

@cowtowncoder
Copy link
Member

So, this is wrt FasterXML/jackson-databind#3380 as well, right?

I think this change needs to go in 2.13(.2), and the place, I think is in base/pom.xml of jackson-bom project?
If so, all actual Jackson repos should start using it.

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