1
votes

I see that a feature I want to build from HEAD (to get the benefit of bug fixes) is in git.eclipse.org. It used to be a bit tricky to build some Eclipse features from source, but now there is Tycho which is supposed to make it easier, because it uses Maven. Fortunately, I see that this feature has already been set up to use Tycho and Maven.

But how to use Tycho as an end-user is not exactly obvious - and I have tried running a Maven build with "clean install" as the Goal, but that failed.

Please give complete step by step instructions for how to run a Tycho build, starting with the source code checkout of the project to build, including installing any necessary software, and finishing with running Eclipse with the desired feature.

Also, what about if I want to make changes to the source code of the plugin(s) within Eclipse - does that mean I should use a different way of building it?


FYI, this is my concrete problem that lead to the general question above: I tried to build the feature org.eclipse.linuxtools/systemtap/org.eclipse.linuxtools.systemtap-feature, and I have the systemtap plugins checked out in sibling directories (because they are part of the same git repository, so I get them for free).

The error is:

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-
plugin:0.14.0:source-feature (source-feature) on project org.eclipse.linuxtools.systemtap: Could not generate source feature for project MavenProject: org.eclipse.linuxtools.systemtap:org.eclipse.linuxtools.systemtap:1.2.0-SNAPSHOT @ /home/greenrd/git/org.eclipse.linuxtools/systemtap/org.eclipse.linuxtools.systemtap-feature/pom.xml
[ERROR] Missing sources for plugins [org.eclipse.linuxtools.systemtap.ui.consolelog_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.editor_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphingapi.ui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.logging_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.structures_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphing_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.systemtapgui_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.ide_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.dashboard_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.dashboardextension_0.3.0.201203201951, org.eclipse.linuxtools.systemtap.ui.graphicalrun_0.3.0.201203201951]
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2
Maven builds don't include a source code checkout. You'll need to do that manually first.oberlies

2 Answers

0
votes

mvn package usually results in packaged plugins and features using a Tycho build. Perhaps your failure is related to using mvn install which also involves running integration tests in the verify phase.

If mvn package does not work, please add the project you're building and the error you're getting.

0
votes

Projects using Tycho are supposed to build like any other Maven project, i.e. you should be able build the project and run its tests by calling mvn clean verify in the root of the project. (If there is no pom.xml in the root, look for a project called something with "parent" or ask the project for their build entry point.)

Just like in Maven, you typically won't be able to check out a project and directly build only parts of it, e.g. by calling mvn an eclipse-feature sub-project. For this to work, you first need to build the whole project once with mvn clean install and then you'll be able to also re-build parts of the project.

In case you do source modifications, I'd recommend to do a full build again. It is possible to build only the changed sub-projects, but you'd also need to ensure manually that all aggregating project types (i.e. "eclipse-feature" and "eclipse-repository") are rebuilt, which is probably not worth the effort. (Unfortunately, the Maven option --also-make-dependents is currently not supported by Tycho.)

In order to install from your local build result, you'll need to find the sub-projct that assembles the project's binaries as a p2 repository: Look for target/repository (or possibly target/site) directories and check the features/plugins sub-folders. The repository or site folder can be used as "Local" source for the update mechanism in Eclipse.


Disclaimer: The steps described above will not work for all projects using Tycho. In case of problems, you should check the project's documentation for special instructions for running their build, or ask the project's developers.