Closed manyuz closed 5 years ago
Hi @manyuz ,
The plugins files (*.groovy
and *.properties
) have to be placed directly under ${ARTIFACTORY_HOME}/etc/plugins
, not in a subfolder in that directory. Also, you don't need to add the *Test.groovy
file there since it is just a test case used by our CI/CD pipelines to validate the plugin.
After you move them there, next time you call the Reload Plugin API you should see a message showing that the plugin was loaded. There is no need to restart Artifactory.
Best. Elio
Hi Elio, Your solution works! Thanks a lot. But I am facing some newer challenges now. For debugging, and to get some more information about the repository path, I have modified the existing script code
log.debug("Scanning File: $currentPath.name") and changed it to log.debug("Scanning File: $currentPath.name" + " Path:::::: " + $currentPath.path)
I get the following error: 2018-12-24 13:11:11,798 [http-nio-8081-exec-1] [ERROR] (o.a.r.c.e.GlobalExceptionMapper:48) - No such property: $currentPath for class: cleanDockerImages groovy.lang.MissingPropertyException: No such property: $currentPath for class: cleanDockerImages
Can you please help me understand how do I get to see these class attributes (interested in properties like RepoPath.getPath(), ItemInfo.getRepoPath(), etc.)
Thanks and Regards, Avi
the $currentPath.path
syntax is for string interpolation, it doesn't make sense outside of a string literal. It should work if you write it like this:
log.debug("Scanning File: $currentPath.name Path:::::: $currentPath.path")
How do you send a REST API command? I have gone through the Reload Plugin Api and when I execute my reload command: curl -i -admin:password -X POST http://
I keep getting this response:
HTTP/1.1 401 Unauthorized Date: Fri, 15 Nov 2019 17:06:44 GMT Server: Artifactory/6.0.3 X-Artifactory-Id: 36100672ff68ca0d:6efc78d3:16e5aac9603:-8000 WWW-Authenticate: Basic realm="Artifactory Realm" Content-Type: application/json Connection: close Transfer-Encoding: chunked
{ "errors" : [ { "status" : 401, "message" : "Unauthorized" } ]
I have the .groovy, .json and .properties files in /etc/plugins
I need some help please!
Hi, I am a rookie to Artifactory User Plugin. I am using the cleanDockerImages plugin for my Artifactory server. These are the steps that I have performed:
Created a folder named "cleanDockerImages" and copied cleanDockerImages.groovy, cleanDockerImages.properties and CleanDockerImagesTest.groovy files from GitHub.
Copied the folder (along with the .groovy and .properties files) in my ${ARTIFACTORY_HOME}/etc/plugins directory.
Created a folder named "lib" in ${ARTIFACTORY_HOME}/etc/plugins, and copied all the dependent jar files. So, my folder structure is something like
${ARTIFACTORY_HOME}/etc/plugins |----lib |-------------artifactory-java-client-api-2.8.1.jar |-------------slf4j-api-1.7.5.jar ....... (other jar files) |----cleanDockerImages |------------cleanDockerImages.groovy |------------cleanDockerImages.properties |------------CleanDockerImagesTest.groovy
Restarted Artifactory server. Also, tried REST API http://:8081/artifactory/api/plugins/reload, but getting a message "Reloaded libs"
Now, if I do the curl command curl -XPOST -uadmin:password "http://localhost:8081/artifactory/api/plugins/execute/cleanDockerImages?params=dryRun=true"
I get the error message:
{ "errors" : [ { "status" : 404, "message" : "No execution plugins are loaded." } ] }
When I execute the REST API to list plugins, http://:8081/artifactory/api/plugins, I get an empty response.
Please let me know what is it that I am doing incorrect here.
Thanks and Regards, Avi.