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

2

14

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?

Altair answered 25/11, 2011 at 10:2 Comment(2)
I made a .target file and tried to use it via "target-platform-configuration" and artifact but it cant resolve dependancies...is only a online repository supportet?Altair
Orri, your comment seems like a different issue. You should ask a new question for it.Prothallus
P
10

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.

Prothallus answered 19/7, 2012 at 18:26 Comment(0)
A
4

Create a repo from your plug-ins and upload it to a http server ( like apache ) and point your tycho pom to the repo

This example is for the mac and eclipse 4 but with some tweaking you can make it work on other platforms.

first create a src folder on the desktop. In this folder create 2 folders : features plugins

Now copy your plugins in the plugins folder and features in the features folder.

Then create an empty destination folder somewhere ( upload this folder to your server)

for this example I created both my folders on the desktop to keep it simple

Then I do this :

destination folder : /Users/yves/Desktop/repo
source folder : /Users/yves/Desktop/src

Terminal app : cd /Applications/Eclipse4

./eclipse  -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/Users/yves/Desktop/repo -artifactRepository file:/Users/yves/Desktop/repo -source /Users/yves/Desktop/src -compress -append -publishArtifacts

The repo folder now contains a repo of your target platform. Upload it, adjust the pom and build.

Amarelle answered 4/8, 2012 at 4:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.