What I needed turned out to be 
jenkins.getDescriptor(org.jfrog.hudson.ArtifactoryBuilder) which gives me 
org.jfrog.hudson.ArtifactoryBuilder.DescriptorImpl 
<http://javadoc.jenkins.io/artifactory/org/jfrog/hudson/ArtifactoryBuilder.DescriptorImpl.html>
 
which allows me to call setArtifactoryServers() 
<http://javadoc.jenkins.io/artifactory/org/jfrog/hudson/ArtifactoryBuilder.DescriptorImpl.html#setArtifactoryServers-java.util.List->
 
to add an artifactorySearvers object to it.

On Thursday, April 26, 2018 at 3:32:32 AM UTC-7, Robert Sandell wrote:
>
> org.jfrog.hudson.ArtifactoryPlugin 
> <https://github.com/jenkinsci/artifactory-plugin/blob/master/src/main/java/org/jfrog/hudson/ArtifactoryPlugin.java>
>  is not implementing an extension point (is not annotated by @Extension) 
> so it's not in the extension list. So jenkins.getPlugin(org.jfrog.
> hudson.ArtifactoryPlugin) is what you should use for that class.
>
> /B
>
> 2018-04-26 1:03 GMT+02:00 Calvin <[email protected] <javascript:>>:
>
>> import org.jfrog.hudson.*
>> import org.jfrog.hudson.ArtifactoryBuilder.*
>>   
>> jenkins = Jenkins.get()
>>
>> def art = jenkins.getPlugin(org.jfrog.hudson.ArtifactoryPlugin)
>> println(art)  // org.jfrog.hudson.ArtifactoryPlugin@2d181762
>> println(art.getWrapper().isActive())  // true
>>
>>  
>>
>> println(jenkins.getExtensionList(org.jfrog .hudson.ArtifactoryPlugin)) // 
>> []
>> println(jenkins.getExtensionList('org.jfrog.hudson.ArtifactoryPlugin'))  
>> // []
>>
>>  
>>
>> println(jenkins.getExtensionList('org.jenkinsci.plugins.github.config.GitHubPluginConfig'))
>>   
>> // [org.jenkinsci.plugins.github.config.GitHubPluginConfig@4508049f]
>>
>>  
>>
>> Artifactory Plugin is installed and active, yet I am unable to get its 
>> instance.
>>
>> I've been using .getExtensionList(String) for customizing plugins via 
>> Groovy. It's been successful for GitLab, GitHub, and many other plugins, 
>> but Artifactory seems to be unique.
>>
>> What's the correct way to configure Artifactory Plugin via Groovy?
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/13af2a23-babe-4021-bc70-732fe824e742%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/13af2a23-babe-4021-bc70-732fe824e742%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Robert Sandell*
> Software Engineer
> CloudBees, Inc.
> [image: CloudBees-Logo.png] <http://www.cloudbees.com/>
> E: [email protected] <javascript:>
> Twitter: robert_sandell
>

-- 
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/0ffd11a6-78e8-4396-9c5e-d4e0dfd268db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to