I have two maven projects:
When I execute them separately, everything works: the first execution creates the repository, and the second can use it.
But I want to create a single pom executing both. The simple approach:
<modules>
<module>p2-repository-generator</module>
<module>tycho-project</module>
</modules>
Doesn't work, because tycho tries to use the repository generated by the first pom even before it exists as described here.
Can I execute two maven tasks sequentially using maven, without external tools? Or can I delay tycho's dependency hook to a later point in the build?
To clarify:
tycho-project
depends on p2-repository-generator
, so it is executed after it.afterProjectsRead
callback - which is too soon, since the p2 repository will be there only after p2-repository-generator
built it.p2-repository-generator
once manually, because then tycho-project
is able to find the p2 repository generated by itAs you correctly noted, Tycho does things very early in the build, which leads to problems if you generate content in the same build to be used by the Tycho build. A workaround for this problem is to wrap the part of the build using Tycho in a maven-invoker-plugin call.