Here's my problem : I have a working tycho build (XText based). The build in maven works fine as long as it has access to the online P2 repositories that are configured in the .target file.
But my client forbids access to the internet on the build machine (Jenkins) : the only access I get is to a nexus maven proxy. The only external files I can pull are through maven dependencies...
So here's the idea I came up with :
- "materialize" the target file,
- bundle the whole tree into a .zip artifact in maven repo
- add this artifact as a in my tycho project
- use the "unpack-dependencies" of the maven-dependency-plugin to expand the directory tree somewhere into the target/
- modify the .target file on the fly with the expand dir path
- let tycho perform its magig
Illustrations :
<dependency>
<groupId>com.jeevaneo</groupId>
<artifactId>xtext-p2-target</artifactId>
<version>0.0.1.0</version>
<type>zip</type>
</dependency>
and
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>unpack-target</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.jeevaneo</includeGroupIds>
<includeArtifactIds>xtext-p2-target</includeArtifactIds>
<outputDirectory>
${project.build.directory}/pde-target
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
The problem I am encountering is that tycho hooks maven's lifecycle : it attempts to load the .target platform before anything else : it thus fails before I get a chance to just unpack the dependency ...
I have tried to make use of -Dtycho.mode=maven : it allows to run the prerequisites (expand etc.) but tycho never kicks in and the build obviously fails.
I have not found how to either :
- trigger some actions (expand zip and so on..) before target resolution by tycho
- use tycho.mode=maven and eventually trigger tycho after everything's setup properly
Am I missing something ? Is there a different way that could work ?
Any help would be greatly appreciated - if I can't manage to make this work, I will have to let Tycho (and thus XText and all the eclipse rest) down and replace it by something more ... "classical" :(
Thanks in advance !