Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven and parallel builds

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to run parallel builds on my continues machine.
Build for different teams.

This is a problem with maven beacsue the artifacts of the parallel builds will be store in the local repository.

The simple solution is to have different repository for each build, but it required a lot of disk space.

Is there another solution like repository only for given group (so it will store the artifact that it build in different respository for each build )


Thank you
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is there an artifact clash? Are they producing identical artifacts?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the same project.

So lets say i have module name XXX version 1, both compile it and instll it when i run mvn install on the parent.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's building an identical artifact then although it's a little redundant I don't see it being a problem?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The project - Reatils
Modules - Customer,Users


In the build machine i have team 1 that work on their stream.
In addioan l i have stream for team 2
And i have stream for integration.

The version is the same (4.4.4), but the stream are seperate.

Now team 1 deliver to stream 1 on the same time that team 2 deliver to stream 2.
The build start to run parallel.

Customer module can be compiled and install at the same name in the repsoitory , because all teams have the same local repository althought that its content is different.

The version is identical for the project and its not snapshot or increment.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would the content of the artifact for each stream be different? If you're not using SNAPSHOT then the content for a properly versioned artifact should be the same.
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont use snapshots!!!

They both team woth on same project version (and same version for all project artifacts) in different streams.

So each team can change any code in their stream, and the artifact that generate will have the same name and the same version for the two teams.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hence my point, if they're the same name and same version they should have the same content (by Maven definition/convention).
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, i am not agree.

You and me develop the same module and the same version (common - 1.0) on our own computers.

If we will go to the local repository on my com and your comp we will have common-1.0.jar with different content.

Since we have different computers we dont have problem, but in case of build machine, when working without snapshot and working with const version we will have problem.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid you're not following the Maven Conventions then. The only way you can get around it is to have separate repositories as you suggested from the start.
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In snapshot you will have the same problem.

Build A - compile and install customer-1.1.1.jar .
In the same time build B copile and install customer-1.1.11.1.jar.

Now when build A reach to the ear part it will take the latest jar (which was build by Build B)
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but with SNAPSHOTs it's understood that the content is going to be different (typically each developer has their own SNAPSHOT in their own repository) and that as it's only very temporary it should not be relied on (as it were). Anyhow, as you say you'll have to go with separate repositories if you've got people working directly off the repositories that your CI build produces.
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. do you know if i can set my local repository via command line?
2. have a repository for each project build will required big disk space any idea how to reduce this, maybee by having repositoyr only for my artifacts , so each build will have local repositoy only for the build artifact and not for apache , juint ....


Thank you
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.) mvn -s allows you to point to an alternative settings file (which in turn can reference a different repository).

2.) Use an artifact repository manager such as Nexus, Artifactory or Archiva (the first two appear to be the best).
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont see how using artifactory can help you here.

when you build your project maven need all artifact (internal and external ) to be in the local , so if each project-build have loal repo, each of them will hold spring and etc on their local. in case of use ant you can tell him to get those "externa artifact " from a library and the internal from the project build workspace.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use artifactory to host your purely shared artifacts and therefore minimise the amount of duplication, best of luck!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic