2

Given the following project setup:

  • Services
    • ServicePackage A
    • ServicePackage B
    • ServicePackage C
    • ...
  • Processes
    • Process 1 (depends on C)
    • Process 2 (depends on A & B)
    • Process 3 (depends on A & C)
    • ...
  • Applications
    • Application X (depends on 1 & 3)
    • Application Y (depends on 2 & 3)
    • ...

what would be the best practice to make a clean build for an application?

tkr
  • 1,331
  • 1
  • 9
  • 27

1 Answers1

1

It depends on whether you are using released version of your dependencies or snapshots. When using the former it does not matter as the necessary versions will be pulled directory from your maven repository server (e.g., nexus, archiva or from your from disk cache).

When using snapshots, you either have to build snapshots by hand or publish the snapshots to your repository server (which can be automated using e.g., hudson). Note that you have to build them in the order they are used. A simple way could be:

  1. Server A, B, C (any internal order),
  2. Process 1,2,3 (any internal order),
  3. Application X, Y (any internal order), .
Johan Sjöberg
  • 47,929
  • 21
  • 130
  • 148
  • We are using snapshots and Hudson. But what about branches that should not be placed in Hudson? – tkr Feb 16 '11 at 16:20
  • You have to build those manually. In distributed development environment, try to avoid using snapshots. The risk is that two developers building the same end-artifact will produce different results based on when they last updated/rebuild the dependant snapshots. – Johan Sjöberg Feb 16 '11 at 16:24
  • Thought about a multimodule build ? The organization of the modules will give you implicit what you want.. – khmarbaise Feb 16 '11 at 16:24
  • How would a multimodule build affect the situation? App X must contain A, C, 1, 3 and must NOT contain B, 2. App Y must contain A, B, C, 2, 3 and must not contain 1. – tkr Feb 16 '11 at 16:57
  • We change the snapshot version for every branch. So there are no conflicts. At the moment we have an SVN working set for every application, but this is a duplication of the information in the application POM. – tkr Feb 16 '11 at 17:05
  • Perhaps the post [Can maven projects have multiple parents](http://stackoverflow.com/questions/1636801/can-maven-projects-have-multiple-parents) is of interest. – Johan Sjöberg Feb 16 '11 at 17:36
  • So finally I have to parse the POM by myself and check it out from SVN recursively. – tkr Feb 18 '11 at 09:51