Reputation: 1876
I have a multi module project like below
The Integration project (pax-exam test) has references to Child1 and Child2, thus recator order will be:
but is required to have Child3 at runtime (osgi-bundle) and fails because Child3 isn't installed yet.
If I specify the Integration project last in my 's section in the parent pom everything works, but as soon as a new project is added it will be appended last in the section and there will be fails all over again.
Is there anyway to force one project to be built/installed last, ie. overriding reactor order determined here http://maven.apache.org/guides/mini/guide-multiple-modules.html ?
I've tried failsafe plugin but the seems to only run integration tests after unit tests INSIDE current project and not the whole stack.
Thanks
UPDATE:
I don't want to add dependencies to Integration project each time a new child project is added just for the sake of getting the Integration project to install last. Then it's just easier to remember to move the Integration module last in list in parent pom modules section.
The dependencies is already taken care of with the features.xml file that is loaded from pax-exam.
Upvotes: 2
Views: 3939
Reputation: 2737
I would suggest adding Child3 to Integration dependencies (I suggest scope provided - which means include in the compile time, but don't include in runtime). Additionally if you don't want Child3 in Integration's transitive dependencies, you might add optional tag. Here is an example:
<dependencies>
<dependency>
<groupId>someGroupId</groupId>
<artifactId>Child3</artifactId>
<version>someVersion</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
Upvotes: 0
Reputation: 38152
Dependencies between projects should be handled in the dependency sections of the POM.
If you need a dependency only at runtime, not at compile time, then add
<scope>runtime</scope>
to the dependency declaration.
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
Upvotes: 2