Java Reference
In-Depth Information
longer need to use <dependency> sections to declare your dependencies—Tycho
ignores them. Although Maven repositories still have their place, how they're used
and what gets put into them are different. If you're a long-time Maven user, you may
find the Tycho experience unsettling; but if your heart lies with Eclipse, Tycho will feel
warm and comforting, like an old pair of slippers.
Because it's so different from conventional Maven, Tycho works best if you've already
got your projects set up in Eclipse, but haven't yet written an automated build for them.
If you already have everything laid out on disk in the standard Maven way, you can make
Tycho work with Maven's build layouts, but it will require extra plug-in configuration.
Tycho is a Maven plug-in, so getting started with Tycho is easy. All you'll need is
Maven 3 and a pom file. One of the nice things about Tycho is that Tycho poms are
small, especially if you put the plug-in configuration in a parent pom (which we
haven't done here!). Almost all of the information needed to build the plug-in is
shared between the IDE and the build tooling.
Listing 8.4
The pom.xml file for a Tycho build of the fancyfoods.business bundle
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fancyfoods</groupId>
<artifactId>fancyfoods.department.cheese</artifactId>
<packaging>eclipse-plugin</packaging>
<version>1.0.0</version>
<name>Fancy Foods Cheese Department Bundle</name>
To generate bundle,
use eclipse-plugin
packaging
Tycho plug-in
must be explicitly
referenced
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.12.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Like Eclipse PDE , Tycho uses the terms plug-in and bundle somewhat interchangeably,
so to build a normal bundle, you'll have to use Tycho's eclipse-plugin packaging
type. Don't worry, Tycho will build you a standard OSG i bundle, despite the name!
Almost all of the information about how your bundle should be built is drawn
from the bundle manifest and the eclipse metadata, rather than the pom. This avoids
duplication, and it has the added bonus that you can use Eclipse's nice tools (which
we'll come to in section 9.1.1) to control things. The symbolic name and version
strings should exactly match the ones in your manifest, but that's the only information
you'll need to duplicate.
 
Search WWH ::




Custom Search