Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] What packaging to use for a myapp.target project?

To conclude this thread: I finally got my project to build with mvn from
the command line.

Here is my project for those that are interested:
 https://github.com/steinarb/modeler

The final blocker was that I had used Import-Package in the MANIFEST.MF
of the .core project, beause that was the first fix that eclipse offered
for my compilation problem.

This caused the build to break with being unable to resolve
"org.eclipse.ui" (which was the package I had imported):

 [ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle modeler.core cannot be resolved
 [ERROR] Resolution errors:
 [ERROR] Bundle modeler.core - Missing Constraint: Import-Package: org.eclipse.ui; version="0.0.0"
 [ERROR] -> [Help 1]
 org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle modeler.core cannot be resolved
 Resolution errors:
    Bundle modeler.core - Missing Constraint: Import-Package: org.eclipse.ui; version="0.0.0"


When I removed the Import-Package statements and let eclipse Ctrl-1
insert the Require-Bundle for the missing bundles, then the project
built both in the IDE and with mvn on the command line.

The thing I spent a lot of time on, before fixing the MANIFEST.MF, was
the .target file.  I first tried to use features from the IDE runtime
which built fine in the IDE, but not at all when using "mvn install".

The documentation actually says that features don't work, by problem is
that I'd never read that far...
 https://wiki.eclipse.org/Tycho/Target_Platform#Target_files

It makes sense I stop to think about it: the mvn build should be able to
work on a continous integration server, where there is no IDE runtime
present, so nothing referring to the IDE runtime will work.

A good guide for how to set up the target file, is this:
 http://codeandme.blogspot.no/2012/12/tycho-build-8-using-target-platform.html

In short:
 - Start with an empty target definition
 - In the target file editor, "Add..." and select "Software Site"
 - Select the update site (in my case http://downloads.eclipse.org/releases/kepler )
 - Uncheck "Group by Category"
 - Add the following 4 features (needed by tycho archetype projects): 
   - Eclipse e4 Rich Client Platform
   - Eclipse Platform
   - Eclipse Platform Launcher Executables
   - Eclipse Java Development Tools

(In addition to the above 4 features, I added GEF)



Back to the top