[!WARNING] This tool is currently in development. Please avoid opening issues until the end of the GSoC 2024 period.
It's configuration and APIs might change in future releases
Plugin Modernizer is a generic CLI tool designed to automate the modernization of Jenkins plugins. It utilizes OpenRewrite recipes, JDOM, and refaster to apply transformations to the plugin, validating the applied transformations and creating pull requests with the results.
Learn more at this project page.
[!NOTE] Currently, this tool does not support checking out plugins from remote repositories. Therefore, one must manually check out the plugin repository into a new directory named
test-plugins
.
mvn clean install
Execute the following command outside the test-plugins
directory:
java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --plugins plugin1,plugin2 --recipes AddPluginsBom,AddCodeOwner
Here, plugin1
and plugin2
are the names of plugin directories, and AddPluginsBom
and AddCodeOwners
are recipe names. For more details about available recipes, refer to the recipe_data.yaml file.
--plugins
or -p
: (required) Name(s) of plugin directory cloned inside the test-plugins
directory.
--recipes
or -r
: (required) Name(s) of recipes to apply to the plugins.
--list-recipes
or -l
: (optional) Displays the list of available recipes.
--dry-run
or -n
: (optional) Enables dry run mode, generating patch files instead of applying changes.
--debug
or -d
: (optional) Enables debug mode.
--cache-path
or -c
: (optional) Custom path to the cache directory
--maven-home
or -m
: (optional) Path to the Maven home directory. Required if both MAVEN_HOME
and M2_HOME
environment variables are not set.
--version
or -v
: (optional) Displays the version of the Plugin Modernizer tool.
The maven build should be reproducible
See
Reproducible Builds for more information.
Ensure the repository is clean before running the following commands (otherwise you can pass the -Dignore.dirty
flag to the maven command).
mvn -Dset.changelist clean install
mvn -Dset.changelist -Dreference.repo=central clean verify artifact:compare
The property project.build.outputTimestamp
will be set with the timestamp of the latest commit.
If you are using a mirror for central
you should adapt the reference.repo
property accordingly to match the id of the mirror in your settings.xml
.