Thanks for the reply ,

I understand the concept of the .m2 folder and generally how maven works.  We 
run an Archiva server where we cache dependencies and publish our released 
artifacts etc etc.  Although having a separate .m2 folder is quite possible and 
would address my issue, it’s something I’m trying to avoid for performance 
reasons.   Pulling down all the external dependencies from Archiva, or central 
repository, for each project takes too long and takes up too much space.  Our 
builds have a customer implementation component which means we have many builds 
for many customers.  What I would like to have is a common .m2 folder for 
external dependencies, and a build specific .m2 folder with just the build 
output.  Something like:

~/.m2/repository
    /log4j
    /commons-io
    /…

$WORKSPACE1/.m2/repository
   /customer1-lib
   /build-lib
   /...

$WORKSPACE2/.m2/repository
   /customer2-lib
   /build-lib
  /...

That way I don’t have to pull down all the common stuff into a fresh .m2 for 
each build.


> On May 19, 2017, at 5:36 PM, Karl Heinz Marbaise <khmarba...@gmx.de> wrote:
> 
> Hi Greg,
> 
> On 19/05/17 19:12, Greg Parker wrote:
>> I’m looking for a way to isolate builds from one another on our Jenkins 
>> server.
> > What I would like to do is have a common .m2 folder
> > for external dependencies.
> 
> > For my own artifacts I’d like to install/retrieve
> >  them to/from a separate local repository.
> 
> > I suspect that this capability does not exist, but I thought I would check.
> 
> The first thing what you need to understand is that the $HOME/.m2/repository 
> is a cache location where the artifacts which are downloaded only cached to 
> prevent repeated downloads from remote repositories..
> 
> The first step is to separate build jobs in Jenkins means that each job has 
> it's own local cache directory which means having the local cache in the 
> workspace ($WORKSPACE/.repository)...
> 
> The second step is having a repository manager (like Nexus, Artifactory or 
> Archiva) which handles the separation between the artifacts which are created 
> by your own and the ones you are consuming from outside (for example from 
> Maven Central)..
> 
> There I would suggest to make this difference for your own artifacts and the 
> artifacts which you call "external"...
> 
> 
> Kind regards
> Karl Heinz Marbaise
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to