jenkinsci / custom-war-packager

Custom Jenkins WAR packager for Jenkins
https://jenkins.io/blog/2018/10/16/custom-war-packager/
MIT License
87 stars 69 forks source link

BOM example #73

Open luis-garza opened 5 years ago

luis-garza commented 5 years ago

I'm trying to build a custom war for pipeline development purposes with the same plugins found in production instance. It's working, but it's quite hard to prepare the plugins section with all dependencies tree, endless try & error work.

So I've tried to specify the plugins through a BOM file without success. Please, could you provide a full CWP demo using BOM file?

oleg-nenashev commented 5 years ago

@luis-garza Hi. Have you seen https://github.com/jenkinsci/artifact-manager-s3-plugin/pull/20 ? BOM is not widely used in Custom WAR packager, and it would benefit from some improvements like automatic groupId resolution

luis-garza commented 5 years ago

Yep, I followed that example from the beginning. Looks like I've found a bug in v1.5, the BOM file specified in the main config YML is not loaded, but it works if I force it with the parameter --bomPath.

In any case, I get the same result as specifying the plugins list in the main config YML. I thought using BOM will resolve recursively all the dependencies, but it doesn't. :(

Would be great for next versions specify just the top parent plugins needed, and resolve recursively all the plugin dependencies. Something like does plugins.txt and the /usr/local/bin/install-plugins.sh script in Docker images.

BTW, thanks for your quick answer and this great tool!

oleg-nenashev commented 5 years ago

@luis-garza w.r.t the plugin management, there is ongoing GSoC project which should streamline management of plugins across Jenkins tools: https://jenkins.io/projects/gsoc/2019/plugin-installation-manager-tool-cli/ . I want to adopt it in CWP once the first alpha version is released. CC @stopalopa

luis-garza commented 5 years ago

@oleg-nenashev Great! This will easy and speed up custom instance and pipeline runner builds!

luis-garza commented 4 years ago

Hi, is there any progress with the plugin installation manager tool? It's already implemented it on CWP?

oleg-nenashev commented 4 years ago

@luis-garza not yet. I had a local branch introducing the tool, but it did not quite work at that point. I have submitted a few patches there, and I plan to try again with the recent Plugin Installation Manager 2.0 release.

Regarding the Maven flow usability, a while ago I created a Jenkinsfile Runner packaging Parent POM: https://github.com/jenkinsci/jenkinsfile-runner/tree/master/packaging-parent-pom . It simplifies packaging of Jenkinsfile Runner, with proper plugin dependency checks and resolution. It might be possible to create a similar packaging POM for classic Jenkins bundles.