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

Add default specification entries, default implementation entries, and Git hash to MANIFEST.MF #419

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

basil
Copy link
Member

@basil basil commented Apr 18, 2023

For the Launchable work, we need a way to get the commit hash from a given artifact in order to define a Launchable build. While this can be derived at runtime by dereferencing the tag back to a commit using the GitHub API, it is simpler to bake this information into the relevant artifact in the first place. This PR adds the following to MANIFEST.MF for all core component .jar files (including shaded JARs) and .war files:

  • Specification-Title: ${project.name}
  • Specification-Version: ${MAJOR.MINOR}`
  • Implementation-Title: ${project.description}
  • Implementation-Version: ${project.version}
  • Implementation-Build: Git hash

The last of these is not part of the default implementation entries but is provided by Build Number Maven Plugin. We use the name Implementation-Build since it is somewhat standardized by the example linked in the previous sentence.

I tested this in Jenkins core, version-number, and Remoting, by building JARs, shaded JARs, and WARs (both a Jenkins core JAR and a Jenkins core WAR) and verifying that they all had Implementation-Title, Implementation-Version, and Implementation-Build set appropriately. I also verified that this allowed me to remove the custom setting of Implementation-Version from jenkinsci/jenkins/war/pom.xml (this is handled now by addDefaultImplementationEntries) and the ``buildnumber-maven-pluginconfiguration fromplugin-compat-tester` (this is now standard configuration for all Jenkins components).

Once this is merged I want to get the same change in for plugins. Plugins never have WAR packaging, but they do have HPI packaging which creates both a .jar and a .hpi file (with the .jar file inside of the .hpi file). The recent work done by @jtnord and myself has added a Plugin-GitHash entry to the MANIFEST.MF file here, but I want to rename that to Implementation-Build for consistency with this PR.

@basil basil changed the title Add default implementation entries and Git hash to MANIFEST.MF Add default specification & implementation entries and Git hash to MANIFEST.MF Apr 18, 2023
@basil basil changed the title Add default specification & implementation entries and Git hash to MANIFEST.MF Add default specification entries, default implementation entries, and Git hash to MANIFEST.MF Apr 18, 2023
@basil
Copy link
Member Author

basil commented Apr 18, 2023

I also added the default specification entries, too. Plugin .jar and .hpi files already have default specification entries and default implementation entries, so this makes core and core component .jar and .war files consistent with that. While I do not need them for Launchable, more consistency seems desirable.

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

Successfully merging this pull request may close these issues.

1 participant