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

MANIFEST.MF missing ImplementationVersion #889

Closed
melloware opened this issue Mar 22, 2023 · 6 comments
Closed

MANIFEST.MF missing ImplementationVersion #889

melloware opened this issue Mar 22, 2023 · 6 comments

Comments

@melloware
Copy link

Looking at your Manifest its missing Implementation version.

This means in Java code I cannot detect the Caffeine version using Caffeine.class.getPackage().getImplementationVersion() which is standard practice. Unless I can get the version some other way?

Manifest-Version: 1.0
Automatic-Module-Name: com.github.benmanes.caffeine
Bundle-License: https://www.apache.org/licenses/LICENSE-2.0
Bundle-ManifestVersion: 2
Bundle-Name: com.github.ben-manes.caffeine
Bundle-SymbolicName: com.github.ben-manes.caffeine
Bundle-Version: 3.1.5
Created-By: 11.0.18 (Eclipse Adoptium)
Export-Package: com.github.benmanes.caffeine.cache;uses:="com.github.b
 enmanes.caffeine.cache.stats";version="3.1.5",com.github.benmanes.caf
 feine.cache.stats;uses:="com.github.benmanes.caffeine.cache";version=
 "3.1.5",com.github.benmanes.caffeine;version="3.1.5"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"
Tool: Bnd-6.4.0.202211291949
@ben-manes
Copy link
Owner

From a quick search, ASM had this mistake and said it was also available in Class.getModule().getDescriptor().rawVersion() but I have not verified. Are there any other manifest attributes that you would recommend?

@melloware
Copy link
Author

Nice well on another Open Source lib I work on this is what we have in there except I removed Export-Package because it was verbose to put here:

Manifest-Version: 1.0
Created-By: Apache Maven Bundle Plugin 5.1.8
Build-Jdk-Spec: 17
Specification-Title: PrimeFaces
Specification-Version: 13.0
Implementation-Title: PrimeFaces
Implementation-Version: 13.0.0-SNAPSHOT
Bnd-LastModified: 1678880661063
Bundle-Description: PrimeFaces is one of the most popular UI libraries i
 n Java EE Ecosystem and widely used by software companies, world renown
 ed brands, banks, financial institutions, insurance companies, universi
 ties and more.
Bundle-License: http://www.opensource.org/licenses/mit-license.php
Bundle-ManifestVersion: 2
Bundle-Name: PrimeFaces
Bundle-SymbolicName: org.primefaces
Bundle-Version: 13.0.0.SNAPSHOT

@ben-manes
Copy link
Owner

ben-manes commented Mar 22, 2023

Thanks. It looks like we could add Implementation-Title, Build-Jdk-Spec, and Bundle-Description.

From this article, there is also packaging sealing. We don't use split packages so it might be safe to enable, if there was a good reason to.

For PrimeFaces, you might consider disabling Bnd-LastModified for reproducible builds (see config option). That is combined with Gradle's preserveFileTimestamps = false and reproducibleFileOrder = true options so that the archives are consistent.

@melloware
Copy link
Author

Ahhh thanks for the tip! I will look at the Felix bundle settings!

@ben-manes
Copy link
Owner

Released in 3.1.6

@melloware
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants