rzo1
rzo1

Reputation: 5751

How to remove outdated Maven artifacts from Jenkins Maven2/3 job?

Over the last couple of months I have restructured (renamed) my Maven modules of my project. I discovered some unexpected behavior with respect to how Jenkins treats outdated Maven modules (i.e., they no longer exist in pom.xml files) produced by the build job.

This is depicted in the following screenshot:

Picture of outdated modules

As can be seen several modules are skipped (= grey bubble). Sadly, however from the UI, I have no chance to delete them by any means. Deleting the workspace does not help either. Actually, the problem exists in other build jobs as well in case a renaming of one ore more modules was conducted in the pom structures.

The next screenshot shows a German version of the menu options.

Menu entries in the project job view

Despite I used the latest Jenkins version (2.23), there seems to be no possibility to clean up the ui / modules from this project.

Does anybody have an idea how I can achieve removing this obsolete artifacts without a fresh setup of the whole project or even the complete build server installation.

EDIT-1:

There is an offical issue for that at the Jenkins Project, which seems to be unresolved up to day.

EDIT-2:

I've tried the work arround mentioned in the issue using http://hudson-installation/job/the-project/deleteAllDisabledModules in order to obtain the delete view. However, this page does not exist.

Upvotes: 14

Views: 2918

Answers (5)

oletjens
oletjens

Reputation: 31

Goto:

http://jenkins-ci/job/<projectname>/<package>$<modulename>/

and click delete.

look at:

http://jenkins-ci/job/<projectname>/modules

Upvotes: 1

TimP
TimP

Reputation: 965

Create a new FreeStyle job and use the same command as you expect developers to use:

mvn clean install

This behaviour is an outstanding bug in the Jenkins Maven Plugin https://issues.jenkins-ci.org/browse/JENKINS-4561

For me it raises a deeper question of why would you ever want to use a plugin for this functionality. It is a DevOps principle to ensure that the developers use and understand the same techniques as are used to build for release.

Upvotes: -3

user6368437
user6368437

Reputation: 116

I think this answer from Amedee Van Gasse provides at least a workaround to your problem.

He suggests removing the modules marked as "(übersprungen)" by hand using a Groovy script. His solution also implies why the use of http://hudson-installation/job/the-project/doDeleteAllDisabledModules won't work: The property disabled isn't properly set for the respective modules.

Upvotes: 3

herrtim
herrtim

Reputation: 2755

Some things you could try as a last resort:

  1. Delete the job, and then recreate it.
  2. Reinstall Jenkins.

Upvotes: 0

DrHopfen
DrHopfen

Reputation: 837

It looks like you are in the menu of a build. You first have to go back to the project "Zurück zum Projekt". Afterward you can delete the project (Assuming you have the necessary permissions).

Upvotes: 0

Related Questions