.getExtensionList('org.jfrog.hudson.ArtifactoryPlugin') returns empty list

73 views
Skip to first unread message

Calvin

unread,
Apr 25, 2018, 7:03:03 PM4/25/18
to Jenkins Developers
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?

Robert Sandell

unread,
Apr 26, 2018, 6:32:32 AM4/26/18
to jenkin...@googlegroups.com
org.jfrog.hudson.ArtifactoryPlugin 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

--
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-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/13af2a23-babe-4021-bc70-732fe824e742%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees, Inc.
CloudBees-Logo.png
Twitter: robert_sandell

Calvin

unread,
Apr 26, 2018, 10:56:25 AM4/26/18
to Jenkins Developers
What I needed turned out to be jenkins.getDescriptor(org.jfrog.hudson.ArtifactoryBuilder) which gives me org.jfrog.hudson.ArtifactoryBuilder.DescriptorImpl which allows me to call setArtifactoryServers() 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 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 <calvi...@gmail.com>:
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 jenkinsci-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages