Plugin dependencies automatically installed

561 views
Skip to first unread message

gsim...@netflix.com

unread,
Mar 23, 2016, 7:53:28 PM3/23/16
to Jenkins Developers
My plugin depends on the mailer plugin (set up as described here https://wiki.jenkins-ci.org/display/JENKINS/Dependencies+among+plugins).  The plugin works, but when I install it it doesn't try and install it's dependencies. 

I hoped that Jenkins would handle installing the dependencies as long as they are listed in my plugin manifest.  For example, the git plugin installs icon-shim and other dependencies when it is installed. 

I suspect that I need to write the code to manage installing my dependencies.  Can someone point me to some example code to get me started.  I searched the git plugin project looking for something that installed other plugins but couldn't find it.

Thanks
George


Slide

unread,
Mar 23, 2016, 8:50:28 PM3/23/16
to Jenkins Developers

The automatic dependency stuff only works if installing via the update center I believe.


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/a975a3fc-6676-4bd0-883c-9ffd776cf115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Neale

unread,
Mar 28, 2016, 10:29:07 PM3/28/16
to Jenkins Developers
If you install via advanced - upload plugin, then it won't install dependencies. It will tell you what is needed though. 

If you have published it to an update center and installed it via one - it WILL bring dependencies. 



the "installNecessaryPlugins" feature may be able to help automate the dependencies. 

Jesse Glick

unread,
Mar 29, 2016, 2:29:46 PM3/29/16
to Jenkins Dev
On Wed, Mar 23, 2016 at 8:50 PM, Slide <slide...@gmail.com> wrote:
> The automatic dependency stuff only works if installing via the update
> center I believe.

Or from `mvn hpi:run` when testing.

Michael Neale

unread,
Mar 29, 2016, 6:15:17 PM3/29/16
to Jenkins Developers
Right - generally I like in hpi:run land until I want it in a "real" jenkins, which would be done via an update center or already likely has the required dependencies installed (this is why this doesn't come up too much I think). 

George Simpson

unread,
Mar 30, 2016, 10:54:24 PM3/30/16
to Jenkins Developers
Thanks for help understanding the difference. Does anyone know the reason plugins installed via 'upload' are treated differently?

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vf3BaCTiU3E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b693b12f-6127-4b68-9631-5ac3af7853c1%40googlegroups.com.

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

Slide

unread,
Mar 30, 2016, 11:02:57 PM3/30/16
to Jenkins Developers
Because the dependency information is stored in the update center information. The JSON contains all the dependent plugins for a specific plugin. If you update a plugin, this information is not available.

You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPHzc0PbHS%2BmXgQTL8oVbtfgvecB%3DwOR1ms0aVLH8vaoJ%3DwxrQ%40mail.gmail.com.

George Simpson

unread,
Mar 31, 2016, 12:41:33 AM3/31/16
to Jenkins Developers
I see.  I noticed that dependencies were listed in the hpi manifest and assumed that was used to identify dependant plugins.
Thanks .


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

Michael Neale

unread,
Mar 31, 2016, 12:43:06 AM3/31/16
to Jenkins Developers
They would be in the Pom.xml and could be calculated, but it would be an expensive operation if possible.

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

-- 
Regards, 

Michael Neale
(twitter: @michaelneale, skype: michael_d_neale)
Cofounder & Engineer @ large in CTO office. 

Daniel Beck

unread,
Mar 31, 2016, 4:49:56 AM3/31/16
to jenkin...@googlegroups.com

On 31.03.2016, at 06:42, Michael Neale <mne...@cloudbees.com> wrote:

> They would be in the Pom.xml and could be calculated, but it would be an expensive operation if possible.

Developers edit the pom. Then maven-hpi-plugin writes them into the manifest, from which they can be read rather easily. That's what the update center does:

https://github.com/jenkinsci/backend-update-center2/blob/2aae8e491d56d4747b9581d160549ca7b56d36fc/src/main/java/org/jvnet/hudson/update_center/HPI.java#L120...L127

Transitive dependencies don't really matter, as they can be resolved by the update center when it installs the direct dependencies.

Jesse Glick

unread,
Mar 31, 2016, 2:53:48 PM3/31/16
to Jenkins Dev
On Wed, Mar 30, 2016 at 10:54 PM, 'George Simpson' via Jenkins
Developers <jenkin...@googlegroups.com> wrote:
> Does anyone know the reason plugins installed via 'upload' are treated differently?

Because the upload feature is not frequently used, and no one ever
bothered to implement automatic dependency handling for this case.
There is no technical reason I know of why it would be difficult.

(Obviously if you are uploading a custom plugin with a dependency on
*another* custom plugin which you forgot to upload first, Jenkins
could do no better than to report a helpful error message, since it
would not be able to locate the dependency in the update center.)

Slide

unread,
Apr 1, 2016, 7:20:06 PM4/1/16
to Jenkins Dev

--

You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr37LbNcaMCW1_SbmiqLmEFkX9-kb1tJiD6KKBFnLctPBw%40mail.gmail.com.

George Simpson

unread,
Apr 1, 2016, 7:25:01 PM4/1/16
to Jenkins Dev
Very cool.  Thanks all!

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vf3BaCTiU3E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVeXtUjea_PA95fmt-eUXF91Zh2eYaUH7Ha2m%3DTSXfwtJQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--
George Simpson
Reply all
Reply to author
Forward
0 new messages