Migrating the Artifactory Plugin
Overview
This page describes the updates and steps required to migrate the Artifactory Plugin from a version earlier than 21.12.1.
For a description of how the JFrog Artifactory plugin integrates with Mend, see Artifactory Plugin Overview .
Installation Updates
In earlier versions, there were 4 jar files that needed to be installed in the plugins/lib
directory of the Artifactory server. From version 21.12.1 of the plugin, only a single jar needs to be installed.
The distribution is bundled in a zip file, with 4 files:
README.md
- describing the plugin usagemend-artifactory-plugin.groovy
mend-artifactory-plugin.properties
mend-artifactory-plugin-VERSION.jar
The plugin should be installed as before, with the following changes:
Replace the
mend-artifactory-plugin.groovy
and themend-artifactory-plugin.properties
files.Remove the 4 jar files from the previous plugin in the
plugins/lib
directory, and place the newmend-artifactory-plugin-VERSION.jar
file in theplugins/lib
directory.
NOTE:
In order to remove files from this location, please add “force.delete
“ to the file name. For example:
mend-artifactory-plugin.groovy.force.delete
wss-agent-report-<version>.jar.force.delete
Deleting the files in any other way may result in the files being re-added automatically by JFrog Artifactory.
Configuration Properties Updates
The following property keys were added:
userKey:
This property was optional in the previous plugin version, but is now mandatory. It should contain a valid Mend user key.
triggerBeforeRemoteDownload:
This is a boolean property (true/false). It can be set in addition to thetriggerBeforeDownload
property. These two properties refer to thebeforeRemoteDownload
andbeforeDownload
hooks, as can be seen in the following docs: https://www.jfrog.com/confluence/display/JFROG/User+Plugins#UserPlugins-Download
Cron Job Configuration
In earlier plugin versions, in order to configure the interval at which the Artifactory repositories were scanned, the following string needed to be modified in the mend-artifactory-plugin.groovy
file:
updateRepoWithmend(cron: "0 28 13 * * ?") {
...
}
From version 21.12.1, the mend-artifactory-plugin.groovy
file looks like this:
/**
* scanRepositoriesCron (java.lang.String) - A valid cron expression used to schedule job runs.
* Modify this parameter to configure the desired schedule to scan your artifactory repositories.
* See README.md for examples.
*/
def scanRepositoriesCron = "0 0 0 * * ?"
jobs {
scanRepositories(cron: scanRepositoriesCron) {
pluginAgent.runRepositoriesScan()
}
}
To configure a schedule for scanning the Artifactory repositories:
Open the
mend-artifactory-plugin.groovy
file in a txt editor.Modify the
def scanRepositoriesCron = "0 0 0 * * ?"
string.