Pipeline and Maven dependency build trigger

1,555 views
Skip to first unread message

dan....@rach.io

unread,
Jun 13, 2016, 5:37:11 PM6/13/16
to Jenkins Users
On non-pipeline Maven jobs, the job can be configured to trigger a build anytime a SNAPSHOT dependency is built, using the flag: "Build whenever a SNAPSHOT dependency is built."

Is there any way to get this same functionality from a pipeline job configured through a Jenkinsfile?

Arnaud Héritier

unread,
Jun 21, 2016, 6:32:48 AM6/21/16
to jenkins...@googlegroups.com
Hi Dan,

  No it isn't possible. There is no integration of the maven plugin with pipeline.
  This feature need is coming again and again but it is more or less broken by design in the maven plugin
  We should better develop a generic plugin allowing to create a new generic plugin that might be able to manage automatic triggers between jobs based on what a job publishes / consumes with some advanced build tools integrations like for maven, gradle ....

Cheers

On Mon, Jun 13, 2016 at 11:37 PM, <dan....@rach.io> wrote:
On non-pipeline Maven jobs, the job can be configured to trigger a build anytime a SNAPSHOT dependency is built, using the flag: "Build whenever a SNAPSHOT dependency is built."

Is there any way to get this same functionality from a pipeline job configured through a Jenkinsfile?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/51b2f01d-6f26-45e8-be53-6422d7340586%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----
Arnaud Héritier
Mail/GTalk: aheritier AT gmail DOT com
Twitter/Skype : aheritier

Richard Hierlmeier

unread,
Nov 23, 2016, 10:43:31 AM11/23/16
to Jenkins Users

Hi Arnaud,

we are i the same situation as Dan. Is there a project or plugin planed or in progress?

--
Richard

Arnaud Héritier

unread,
Nov 23, 2016, 1:35:42 PM11/23/16
to jenkins...@googlegroups.com
I think I had this discussion with many people but AFAIK there is no project / work in progress :(

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/bef74f26-b7e7-4f1d-9310-fb916696ce03%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Richard Hierlmeier

unread,
Nov 23, 2016, 3:39:25 PM11/23/16
to Jenkins Users

It is surely possible to create with the mavenJob call the corresponding maven jobs.
But how can the so created maven jobs be deleted once a branch is deleted?

Arnaud Héritier

unread,
Nov 23, 2016, 4:52:02 PM11/23/16
to jenkins...@googlegroups.com
Using pipeline multibranches / organisation folders you can easily create/delete builds in jenkins based on what you have in your SCM
The complexity is then to manage the triggering which requires 2 things :
1/ For a project you need to analyse its outputs (artifacts) to detect what is published
2/ For a project you need to analyse its dependencies to understand what it consumes

When you have both of them you can create triggers between publishers and consumers

The ideal should be to have something generic which could be implemented by various build tools
It's not easy to implement depending of the tools:
* It is often different what you are building and what you are publishing. Also depending where you are publishing it may not have been seen / usable by consumers (maven jobs aren't really taking care of that nowadays)
* dependencies resolution can be more or less dynamically computed during a build thus it  ~ impossible to know what you will consume before starting the build (that's why a maven job has always a build late - deps are up-dated after the build)
* artifacts identification and versioning can be different depending of the build tool (ex: Maven SNAPSHOTs). depending of the build tool also you may have some issues by managing everything automatically. If several branches of the same project are publishing the artifacts with the same identity/version you may mix-up everything in you repository manager (or the space you are using to share your binaries)




To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f57c5861-ab70-4067-a72b-330ee448b942%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Richard Hierlmeier

unread,
Nov 24, 2016, 4:41:18 AM11/24/16
to Jenkins Users

I am thinking about the following use case
  • Use the jgitflow-maven-plugin to create for each feature a branch. This plugin sets in the pom a branch dependent version number (x.x.x-<branch_name>-SNAPSHOT).
  • In Jenkins a multibranch job is triggered. It performs the maven build and deploys the results. The produced items are identified by groupId:artifactId:version
  • In a final steps the job analyzes the pom and scans the dependencies. This brings me the list of consumed items (also identified by groupId:artifactId:version)
  • Store somewhere the produced and consumed items for the job
  • Lookup all jobs which consumes my produced item and trigger a build.
Is an implementation of such an use case with the current feature set already possible?

Does Jenkins have a place where the produced an consumed items of a job can be stored? Jenkins is a distributed system. The information must be shared between all slaves.
Reply all
Reply to author
Forward
0 new messages