How can I use a local directory as target platform for a Tycho build?

Orri picture Orri · Nov 25, 2011 · Viewed 8.4k times · Source

I want to build an RCP-Application with a target platform which is a directory with Maven/Tycho.
Now I have some troubles that the dependencies could not be resolved.

Internal error: java.lang.RuntimeException: "No solution found because the  
problem is unsatisfiable.": ["Unable to satisfy dependency from  
de.test.prototype.main 1.0.0.qualifier to bundle org.eclipse.ui 0.0.0.",  
"Unable to satisfy dependency from de.test.prototype.main 1.0.0.qualifier  
to bundle org.eclipse.core.runtime 0.0.0.", ...

All in all there are several dependency resolution problems, so I think Tycho can't use my target platform.
I read http://wiki.eclipse.org/Tycho/Target_Platform and there is the following note:

The location types "Directory", "Installation", and "Features" are not supported."

So my question is: How do I get Tycho to use my target platform, although it is a directory?

Answer

oberlies picture oberlies · Jul 19, 2012

Tycho requires p2 metadata in order to resolve dependencies in your build. This is why a folder with just bundles and features can't be used.

However you can convert your folder into a p2 repository by using the Features and Bundles Publisher Application. After you have done this, you can to reference the folder as "Software Site" location through a file: URL in your target definition file. Then Tycho will also be able to use it.

Note however that you should first be asking yourself if you really need to do this: Are the features and bundles in your folder really not available in any p2 repository? If they are, it is strongly recommended to not run the Features and Bundles Publisher on them (or you may be causing violations of basic assumptions of p2 which may lead to problems that are typically only visible to your users). Instead, you should reference these features and bundles directly from the p2 repository, e.g. via "Software Site" location in your target file.