I do similar to Eric for jenkins. But also for both developer builds and jenkins, I've got all projects setup to use the http://www.mojohaus.org/build-helper-maven-plugin/remove-project-artifact-mojo.html plugin. With both a default and clean phase execution. So when either jenkins or a developer does a clean, old artifacts are removed. This I find stops the need to intervention of having to manually clean up the local repo.
I've also got a local artifactory instance running inside a vagrant vm, so i can safely delete my local repo if I've trouble and it can download what i needs to again. It also helps when working offline or over a slow internet connection as most things I've already download previously. John On 12 September 2017 at 12:56, Eric B <ebenza...@gmail.com> wrote: > I have my jenkins jobs designed to use private m2 repos per job. I dont > find the need to delete them since the only transient changes are the > snapshots, which get reevaluated at every build anyhow. > > Thanks > > Eric > > > On Sep 11, 2017 2:43 PM, "Stephen Connolly" <stephen.alan.conno...@gmail.com> > wrote: > > On Fri 8 Sep 2017 at 11:22, Baptiste Mathus <m...@batmat.net> wrote: > >> Le 7 sept. 2017 17:00, "Tushar Kapila" <tgkp...@gmail.com> a écrit : >> >> I had to delete a directory once as i had pressed Ctrl-C while it was >> downloading jars and a 0kb jar was created. This was in 2013, maybe it >> downloads to a temp file and then create the final file? It took sometime >> to debug. Builds were failing for no reason only on that test box, but >> working fine on my dev box, lots of fun. >> >> > If you don't, and >> > you have static (persistent) agents, very bad things will happen at some >> point. >> >> Can you explain this? What agents? >> >> >> Hehe, I was talking about Jenkins agents, sorry just realized I mixed my >> MLs. I thought I was reading Jenkinsci-users one :). > > > Bad Ba(p)tiste™ > > ;-) > > >> >> >> On Thu, Sep 7, 2017 at 1:59 PM, Baptiste Mathus <m...@batmat.net> wrote: >> >> > 2017-09-07 9:17 GMT+02:00 Guang Chao <guang.chao.1...@gmail.com>: >> > >> > > On Fri, Sep 1, 2017 at 11:31 AM, mingleizhang <zml13856086...@163.com> >> > > wrote: >> > > >> > > > Hello friends here. >> > > > >> > > > >> > > > I would like ask a question ,it probably looks silly, but I >> still >> > > > want to know. As the subject said, when time do we need to delete >> > > > .m2/repository files ? Does anyone improve my mind ? Thank you very >> > much! >> > > > >> > > > >> > > > >> > > There is no need to do this unless you are out of disk space. It will >> > cause >> > > no harm, but maven will redownload all dependencies again. So that > will >> > > slow you down a bit. >> > > >> > >> > I am actually going to say the contrary. You should, at I'd even say, > you >> > *must* wipe out Maven repositories on a regular basis. If you don't, and >> > you have static (persistent) agents, very bad things will happen at some >> > point. >> > >> > So, yeah, redownloading it is going to add some time to build, but this >> is >> > a matter of speed vs. reproducibility, so better target >> reproduciblity/non >> > flakiness then see how to optimize, not the contrary. >> > >> > And obviously, *NEVER, EVER share that .m2/repository between running >> > builds*. >> > >> > >> > > >> > > >> > > > Thanks >> > > > Rice. >> > > >> > > >> > > >> > > >> > > -- >> > > Guang <http://javadevnotes.com/java-string-to-integer-examples/> >> > > >> > >> >> >> >> -- >> Regards >> Tushar Kapila >> > -- > Sent from my phone --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org