Hudson/Jenkins Plugin development: how to get environment variables of other plugin

neves :

I'm in a somewhat old Hudson configuration. We have an in house developed plugin that query a Nexus repository and set some job parameters. The plugin is in Java.

We also use the depreacated SetEnv Plugin, where we set a bunch of environment variables.

Our plugin, basically extends the ParameterDefinition class to give a bunch of options in the build job screen, then a ParameterValue class set environment variables for our jobs.

Our Parameter Definition classe:

class NexusQueryParameterDefinition extends ParameterDefinition

Is it possible to access the environment variables defined in the SetEnv plugin from our Parameter Definition class?

The problem that I'm at definition time of a a parametrized build, that is the screen between when I press the button "build now" and when I press the button "Build" to start the process. At this point I don't know how to access the job instance object and I believe the build object just will be created when the form is submitted.

These environment variables are persisted in the config.xml, so if I can read this file I can parse the values.

neves :

It looks like it isn't possible without changing Hudson/Jenkins code.

Here is a link about it: https://groups.google.com/forum/#!topic/jenkinsci-dev/2hLy525cxsg

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=441163&siteId=1