You can't clean in the maven pom - as the maven pom is what will use what you are trying to clean :-o
However - even if Max could selectively clean the repo I don't think it would scale. With Gerrit - you can end up with many changes submitted at the same time - and you don't want to run them serially (feedback loop is too long). As such you need multiple workspaces - and you need multiple executors as well. As no one writes well behaved unit tests the best practice is to use 1 executor per slave. At this point the likely hood of getting a slave that has the workspace that Jenkins wants is possibly slim. So even if you could - you may end up getting wildly different build times in various cases. There is likely more to be gained (long term) from using shallow clones and reference repositories. If you have a good maven chache close to you build server - the time to download isn't the dominating factor anymore (and downloads can be performed in parallel, and modules can be built in parallel with Maven3 - so the download time end up not blocking/contributing to the build time by any significant amount) What possibly would help is layered local maven repository support (something that Jason has mooted several times on the Maven lists) - but nothing is available yet. (but that then assumes that all projects use the same maven settings (for all mirrors and have a mirror of * fallback). /James From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Mark Waite Sent: 13 February 2014 23:53 To: jenkinsci-users@googlegroups.com Subject: Re: Git Plugin: "Clean after checkout" exclusions? If the "Clean after checkout" option you are referencing is the option from the git plugin, then I would rather suggest that you should adapt and maintain some form of build specific clean within your maven pom.xml, rather than complicating the git plugin with inclusions and exclusions for the operation. The "Clean after checkout" option in the git plugin is conceptually mapped to "git clean -xfd". Your exclusion / inclusion proposal has no matching concept in the git command line nor in JGit. I'd rather not see the git plugin stray from its conceptual mapping to git commands. It is complicated enough already. Mark Waite On Thu, Feb 13, 2014 at 4:34 PM, Max Spring <m2spr...@springdot.org<mailto:m2spr...@springdot.org>> wrote: I'm using the "Clean after checkout" option a lot with my Gerrit verification Maven jobs. I also have these jobs use a local repository, sitting in the job's workspace. Because of the "Clean after checkout" option set, the job's local repository gets wiped and the subsequent build has to time-consumingly repopulate it with lots of artifacts. I'd like to speed this up. Ideally, I'd like to exclude certain directories/files from being removed when using the "Clean after checkout" option is set. Sort of: "exclude=$WORKSPACE/.repository" In addition to an exclude option for "Clean after checkout", I would like to have an include option, where I would then specify certain hierarchies within the private local repository to be cleaned, like "include=$WORKSPACE/.repository/org/myorg/". -Max -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users%2bunsubscr...@googlegroups.com>. For more options, visit https://groups.google.com/groups/opt_out. -- Thanks! Mark Waite -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.