Certified Jenkins Engineer

Extending Jenkins and Administration

Demo Managing Plugins

In this hands-on guide, we’ll uninstall and clean up the Copy Artifact plugin in a simple chained-job workflow: ascii-build-jobascii-test-jobascii-deploy-job. By the end, you’ll know how to verify artifact handling, remove a plugin, and ensure no orphaned configuration remains.

Table of Contents

  1. Job Workflow
  2. Step 1: Verify Build Job Generates Artifact
  3. Step 2: Configure Test Job to Copy Artifacts
  4. Step 3: Trigger Builds and Observe Workflow
  5. Step 4: Confirm Plugin Installation
  6. Step 5: Locate Plugin on Filesystem
  7. Step 6: Uninstall Copy Artifact Plugin
  8. Step 7: Re-run Jobs After Uninstallation
  9. Step 8: Inspect Job Configuration
  10. Conclusion

Job Workflow

Job NamePurpose
ascii-build-jobFetches advice from API, archives advice.json
ascii-test-jobCopies advice.json with Copy Artifact Plugin and validates word count
ascii-deploy-job(Optional) Deploys validated advice to target system

Step 1: Verify Build Job Generates Artifact

On the ascii-build-job dashboard, confirm the build archives advice.json successfully.

The image shows a Jenkins dashboard for a project named "ascii-build-job," displaying build flow and downstream projects with links to build history and artifacts.


Step 2: Configure Test Job to Copy Artifacts

In ascii-test-job, add a Build Step → Copy artifacts from another project. Select:

  • Project name: ascii-build-job
  • Which build: Latest successful build
  • Artifacts to copy: advice.json

The image shows a Jenkins configuration screen for a job named "ascii-test-job," focusing on the "Build Steps" section where artifacts are being copied from another project. The interface includes options for selecting the project name, build type, and specific artifacts to copy.


Step 3: Trigger Builds and Observe Workflow

  1. Click Build Now on ascii-build-job.
  2. Review console output to ensure advice.json was archived:
$ ls advice.json
advice.json
$ cat advice.json
{"slip":{"advice":"Don't promise what you can't deliver."}}
$ jq -r .slip.advice
Don't promise what you can't deliver.
$ wc -w advice.json
6 advice.json
  1. Both ascii-build-job and ascii-test-job should pass:

The image shows a Jenkins dashboard for a job named "ascii-build-job," displaying its build flow, downstream projects, and build history. The job appears to have been successfully built recently.


Step 4: Confirm Plugin Installation

Navigate to Manage Jenkins → Manage Plugins → Installed. Verify Copy Artifact is listed:

$ cd $JENKINS_HOME/plugins
$ ls | grep -i copy
copyartifact.jpi

The image shows the Jenkins plugin management interface, specifically the "Installed plugins" section, with a search for "copy" displaying the "Copy Artifact" plugin.


Step 5: Locate Plugin on Filesystem

From a terminal (or IDE), inspect the plugin file:

$ cd $JENKINS_HOME/plugins
$ ls | grep -i copyartifact
copyartifact.jpi

The image shows a terminal window in Visual Studio Code displaying a list of Jenkins plugin files with the ".jpi" extension. The terminal is connected to a remote server, and the files are organized in columns.


Step 6: Uninstall Copy Artifact Plugin

  1. Go to Manage Plugins → Installed.
  2. Click Uninstall next to Copy Artifact.
  3. Confirm the dialog to remove the plugin binary.

The image shows a Jenkins interface with a confirmation dialog asking if the user wants to uninstall the "Copy Artifact" plugin, with options to cancel or proceed.

Note

Uninstalling removes copyartifact.jpi from $JENKINS_HOME/plugins, but job XMLs still reference the plugin until Jenkins is restarted.


Step 7: Re-run Jobs After Uninstallation

Trigger ascii-build-job again, then ascii-test-job. You’ll see the copy step succeed (artifact already on disk), but Jenkins still internally uses the missing plugin reference:

[ascii-test-job] $ /bin/sh -xe /tmp/jenkinsXXXX.sh
+ ls advice.json
advice.json
+ cat advice.json
{"slip":{"advice":"Don't try and bump start a motorcycle on an icy road."}}
+ jq -r .slip.advice
Don't try and bump start a motorcycle on an icy road.
+ wc -w advice.json
11 advice.json

The image shows a Jenkins dashboard for a job named "ascii-test-job," displaying build flow details, upstream and downstream projects, and build history.


Step 8: Inspect Job Configuration

Open ascii-test-job/config.xml and locate the plugin reference:

<project>
  <builders>
    <hudson.plugins.copyartifact.CopyArtifact plugin="[email protected]_dca_a_9b_6549">
      <project>ascii-build-job</project>
      <filter>advice.json</filter>
      <selector class="hudson.plugins.copyartifact.StatusSelector">
        <stable>true</stable>
      </selector>
    </hudson.plugins.copyartifact.CopyArtifact>
    <!-- ... other builders ... -->
  </builders>
</project>

Without the plugin binary, this builder will error after a Jenkins restart. A full restart is required to purge these orphaned entries.

Warning

After uninstalling a plugin, always restart Jenkins to remove its XML elements from job configurations.


Conclusion

To fully remove a plugin and its configuration:

  1. Uninstall the plugin via Manage Plugins.
  2. Restart Jenkins to clean up any residual <plugin> elements in job config.xml files.

For more information, see the Jenkins Plugin Management documentation.

Watch Video

Watch video content

Previous
Demo Installing Plugins