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

Include Package Version Information in MANIFEST.MF #4189

Open
melloware opened this issue Feb 20, 2025 · 3 comments
Open

Include Package Version Information in MANIFEST.MF #4189

melloware opened this issue Feb 20, 2025 · 3 comments
Labels
Platform: Java Type: Bug Something isn't working

Comments

@melloware
Copy link

Integration

sentry

Java Version

11

Version

8.2.0

Steps to Reproduce

Your Manifest is how JARS are identified.

For example:
SentryRuntime.class.getPackage().getImplementationVersion() returns NULL because your manifest is empty.

A proper manifest you can genereate with GRADLE easily to look something like this... from Caffeine.

Manifest-Version: 1.0
Automatic-Module-Name: com.github.benmanes.caffeine
Build-Jdk-Spec: 11
Bundle-Description: A high performance caching library
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.8
Export-Package: com.github.benmanes.caffeine.cache;uses:="com.github.b
 enmanes.caffeine.cache.stats";version="3.1.8",com.github.benmanes.caf
 feine.cache.stats;uses:="com.github.benmanes.caffeine.cache";version=
 "3.1.8",com.github.benmanes.caffeine;version="3.1.8"
Implementation-Title: A high performance caching library
Implementation-Version: 3.1.8
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"

Here is how Temporal.io solved it in their SDK with Gradle.

 afterEvaluate { subproject ->
        jar {
            manifest {
                attributes(
                        "Implementation-Title": subproject.description,
                        "Implementation-Version": subproject.version,
                        "Implementation-Vendor": "Temporal Technologies Inc.",
                        'Build-Time': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
                )
            }
        }
    }

Expected Result

A MANIFEST.MF with proper identifying entriues.

Actual Result

MANIFEST.MF is blank in all JARS.

@melloware
Copy link
Author

For example in our Quarkus Logging Sentry extension i want to display the current SDK version on the Dev Card.

Image

But can't because your manifest is empty.

@romtsn
Copy link
Member

romtsn commented Feb 21, 2025

hi @melloware thanks for opening the issue - I don't see any problems with doing that, we're already doing that partially for our otel-agent. We'll look into doing that for other modules too!

@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
Platform: Java Type: Bug Something isn't working
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

3 participants