Empty Folder Clean-up

JFrog Support
2018-04-29 14:06

For Artifactory 5.X and above, please use the plugin mentioned and linked below to clean up empty folders.

For Artifactory 4.X and below, during automatic folder-cleanup, the following actions take place: 


  • Whenever a copy, move or delete action is performed on a repository, Artifactory triggers a ‘prune empty folders’-process that runs on the repository’s root folder and drills down to search and delete empty folders. 
  • After things are marked for clean-up, the process is then performed when Artifactory is relatively inactive.  
  • Each time that an iteration of the process is triggered and runs, the folder at the outermost level (farthest from the root folder) will be removed; over time all empty directories will be removed. 
  • Because the process requires certain actions to trigger, and due to the delay while Artifactory waits to run things after the initial trigger, getting to a point where all empty folders have been deleted can take some time. Something on the order of 5 or 10 minutes might be expected for a typical folder structure…


One can also use an Artifactory plug-in to initialize the folder-cleanup manually. This will immediately remove empty folders under repositories that are specified, and will bypass iterative process discussed previously.

Please refer to the following information if you wish to install and use this plugin:

  • Installing and using Artifactory plugins (general): Please note that ‘groovy v1.8’ will need to be installed to use our plugins

  • Github link to the DeleteEmptyDirs plugin/script:

    • Specific instructions for using this plugin can be found in the comments below ‘executions’

    • In particular, you can see an example curl command:

      • curl -X POST -v -u <username>:<password> "http://<Artifactory server-address>:<Artifactory-port>/artifactory/api/plugins/execute/deleteEmptyDirsPlugin?params=paths=<comma separated list of repositories to search>"

 Whether you are relying on the automatic clean-up functionality or using the plugin, empty folders will be removed regardless of whether or not properties have been set on them.