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

Remove accidentally included package-info.class in all packages #7855

Closed
gonphsn opened this issue Apr 7, 2022 · 8 comments · Fixed by #7856
Closed

Remove accidentally included package-info.class in all packages #7855

gonphsn opened this issue Apr 7, 2022 · 8 comments · Fixed by #7856
Labels

Comments

@gonphsn
Copy link

gonphsn commented Apr 7, 2022

Jetty version
jetty-all-compact3-9.4.46.v20220331.jar vs jetty-all-compact3-9.4.45.v20220203.jar

Java version
N/A

Question
I observed in a diff of the contents of jetty-all-compact3-9.4.45 and jetty-all-compact3-9.4.46 that the latter now contains a package-info.class at every package. See:

image

It was not immediately clear to me from the release notes where this may have been introduced. I know compact3 can be an often overlooked profile, and while the file size increase is marginal, I was curious if this was intentional?

Maybe compact3 has nothing to do with it - I'll compare this to the standard profile as well. UPDATE: It is also in the standard distributions, so nothing to do with compact3 I think.

Thanks!

@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

There's been no updates to the pom for the compact3 build in a long time.

https://github.com/eclipse/jetty.project/blob/jetty-9.4.x/aggregates/jetty-all-compact3/pom.xml

The most recent update was 17 months ago. (commit 3e35ec3)
And was first present on jetty-9.4.35.v20201120

Not sure how you see differences in 9.4.45 to 9.4.46.

Do we need another exclusion on dependency:unpack-dependencies perhaps?

@gonphsn
Copy link
Author

gonphsn commented Apr 7, 2022

@joakime I've concluded that this is not a compact3 specific issue - it is just where I noticed it first since that is the build we consume. Sorry for the red herring.

See the following diff just from standard profile distributions published at maven central:

image

@gonphsn gonphsn changed the title Jetty 9.4.46 compact3 now contains package-info.class in all packages Jetty 9.4.46 now contains package-info.class in all packages Apr 7, 2022
@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

I can confirm that package-info.class is now present on 9.4.46, but not older releases.
This seems like a maven-jar-plugin behavior change.

@olamy any thoughts?

@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

The maven-compiler-plugin is actually compiling them into ${project.basedir}/target/classes. Hmm...

@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

Confirmed, maven-compiler-plugin version 3.10.0 (and the newest 3.10.1) both start compiling the package-info.java files into target/classes.
The older maven-compiler-plugin 3.9.0 does not.

@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

joakime added a commit that referenced this issue Apr 7, 2022
…class files

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@gonphsn
Copy link
Author

gonphsn commented Apr 7, 2022

Ok, thanks for the confirmation on your end.

@gonphsn gonphsn closed this as completed Apr 7, 2022
@joakime
Copy link
Contributor

joakime commented Apr 7, 2022

I opened PR #7856 to configure the maven-compiler-plugin to not do that anymore on our builds.

You can compile with -Dmaven.compiler.createMissingPackageInfoClass=false to make the compiler plugin behave like before.

joakime added a commit that referenced this issue Apr 7, 2022
…class files (#7856)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Apr 7, 2022
…class files

Cherry-pick of commit 1678a21

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Apr 8, 2022
…class files (#7857)

Cherry-pick of commit 1678a21

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@joakime joakime changed the title Jetty 9.4.46 now contains package-info.class in all packages Remove accidentally included package-info.class in all packages Jun 10, 2022
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