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

Parent Packaging POM: Support for exporting a plugin manifests file #389

Open
oleg-nenashev opened this issue Oct 9, 2020 · 4 comments
Open
Labels
developer Features for those who extend Jenkinsfile Runner
Milestone

Comments

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Oct 9, 2020

JFR Packaging POM currently prepares a Jenkinsfile Runner bundle (appassembler ZIP) where plugins are included into the bundle. They are available in the classpath, but JFR Plugin Manager cannot recognize the plugins because of the missing plugin Manifest resources. After that, API like PluginManager#getPlugin(String) do not work properly and cause random issues in plugins. It would be nice to have a way to read proper manifests of plugins included into classpath.

Acceptance criteria

  • There is a build step which generates a manifest file for plugins passed as dependencies. Maybe it should be implemented as a new mojo in Maven HPI Plugin
  • Manifest file has a machine readable format. It maybe an update center JSON or a new YAML definition
  • Manifest file is documented in the JFR Packaging POM readme

References

Example MANIFEST file

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: Oleg
Build-Jdk: 1.8.0_201
Extension-Name: promoted-builds
Specification-Title: The Jenkins Plugins Parent POM Project
Implementation-Title: promoted-builds
Implementation-Version: 3.6
Group-Id: org.jenkins-ci.plugins
Short-Name: promoted-builds
Long-Name: Jenkins promoted builds plugin
Url: https://github.com/jenkinsci/promoted-builds-plugin
Compatible-Since-Version: 3.0
Minimum-Java-Version: 1.8
Plugin-Version: 3.6
Hudson-Version: 2.121.1
Jenkins-Version: 2.121.1
Plugin-Dependencies: rebuild:1.31;resolution:=optional,project-inherit
 ance:1.5.3;resolution:=optional,maven-plugin:3.2;resolution:=optional
 ,apache-httpcomponents-client-4-api:4.5.3-2.1,config-file-provider:2.
 18;resolution:=optional,credentials:2.1.4,job-dsl:1.74;resolution:=op
 tional,junit:1.20,script-security:1.54,ssh-credentials:1.13,structs:1
 .19,token-macro:2.0;resolution:=optional
Plugin-Developers: Kohsuke Kawaguchi:kohsuke:,Peter Hayes:petehayes:,O
 leg Nenashev:oleg_nenashev:

@oleg-nenashev oleg-nenashev added the developer Features for those who extend Jenkinsfile Runner label Oct 9, 2020
@oleg-nenashev oleg-nenashev changed the title Parent Packaging POM: Support for exporting plugin manifests to separate build destination Parent Packaging POM: Support for exporting a plugin manifests file Oct 9, 2020
@oleg-nenashev oleg-nenashev added this to the jfr-1.0 milestone Oct 9, 2020
@oleg-nenashev
Copy link
Member Author

Such file could be also a resolution for https://issues.jenkins-ci.org/browse/JENKINS-48885 in Jenkins Test Harness. It makes a JSON format preferable so that we do not need to include YAML libs into the developer tooling

@sladyn98
Copy link

@oleg-nenashev So if I understand correctly in order to get this solved JFR needs to have a build step that generates a manifest file(update center JSON) that plugin manager can then pick up.

Question: In order to implement the build step in the maven hpi plugin we would need to read the dependencies from the manifest file right ? Would this mean submitting a patch to maven HPI plugin modifying the generation of the manifest ?

Alternative: Could we read it from the class path and generate the manifest ourselves ?

@oleg-nenashev
Copy link
Member Author

In order to implement the build step in the maven hpi plugin we would need to read the dependencies from the manifest file right ?

No, you would not. Maven HPI Plugin is the thing which generates this file. You do not need to implement file roundtrips, all the logic is already there.

Would this mean submitting a patch to maven HPI plugin modifying the generation of the manifest ?

Likely. Note that plugin manifest file may have two meanings: MANIFEST.MF for HPI files, and a standalone file for multiple files. Here I mean the latter

Could we read it from the class path and generate the manifest ourselves ?

It might be possible to extract existing files and put them somewhere accessible to the resource classloader.

@oleg-nenashev
Copy link
Member Author

oleg-nenashev/lib-bom-jep309#1 as a foundation lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Features for those who extend Jenkinsfile Runner
Projects
None yet
Development

No branches or pull requests

2 participants