> Am 19.05.2021 um 11:42 schrieb HALLEY SALAM <[email protected]>:
> 
> Greetings,
> 
> I am new to Jenkins and just started contributing to developing a plugin for 
> Jenkins where I need to extract some values from the job config.xml.
> 
What do you want to read?


> I am able to retrieve the config.xml with the below approaches:
> 
> Accessing through /config.xml
> By creating Jenkins client and invoking getJobXml() method passing the job 
> name

Both approaches are wrong. Please use the Java API to access the values from 
the corresponding Java objects. The XML representation is an internal structure 
that should not be read by some other tool. 

But in both the cases I need to pass the Jenkins credentials which shall not be 
the case since I am trying to access from within the running Jenkins instance. 
And also above approaches can be implemented in any external project if one 
knows the credentials to access the Jenkins instance. I want an approach which 
shall be bound within the plugin meaning I shall be able to read the config.xml 
via the job name without providing any credentials.
> Could anyone provide me the best solution to read the config.xml within the 
> java code? Any assistance is highly appreciated. Thank you in advance.
> 
> Regards,
> Halley
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BNFquB7XvRo_8rG1C0Qn3J74vvc6%3D41ABytJSZ2eW1_JoHo3Q%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BNFquB7XvRo_8rG1C0Qn3J74vvc6%3D41ABytJSZ2eW1_JoHo3Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/FBF931D4-620D-4E53-845F-FE9E1DBA2E8E%40gmail.com.

Reply via email to