I have an osgi project that is split into 3 repositories. Each repository has its own build into p2 repository with Tycho:
Repo1 -> P2 repo 1
Repo2 -> P2 repo 2
Repo3 -> P2 repo 3
Also each repository has a target definition file that includes the bundles from third party p2 repositories and from another project repositories (P2 repo1, P2 repo 2 or P2 repo 3 above). Repo2 contains a dependency to Repo1 bundles, Repo3 has dependencies to the Repo1 and Repo2 bundles:
Repo1 Target Definition -> Eclipse Orbit P2
Repo2 Target Definition -> Eclipse Orbit P2, P2 repo1
Repo3 Target Definition -> Eclipse Orbit P2, P2 repo1, P2 repo2
Now I have the following problem. After building the first repository, the P2 repo1 repository updated and contains the feature with the new snapshot versions. The target definitions of Repo2 and Repo3 depend on the previous snapshot version of Repo1 bundles and building these repositories is impossible without updating the appropriate target definitions (In Eclipse there are Update button in Target Editor).
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.myproduct.feature.api.game.feature.group" version="1.0.0.201509251400"/>
<unit id="com.myproduct.feature.impl.game.feature.group" version="1.0.0.201509251400"/>
<repository location="http:............../target/repository/"/>
</location>
So it is impossible automatically build all 3 repos, so the build process becomes too complicated:
- Commit the changes in the first repo and build it with Jenkins
- Update the target definition of repo2 to point it to the new version of repo 1 feature
- Commit this update in repo2 and build it with Jenkins
etc....
I am thinking now to use git submodules for integrating these 3 repos to avoid the p2 repositories or move all in one repository.