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.

Answer

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.

Attribution
Source : Link , Question Author : rzo1 , Answer Author : Community

Leave a Comment