Eclipse Tycho簡介#
Tycho is an project which provides a set of Maven plug-ins for building Eclipse components via the command line. Tycho supports the build process of Eclipse plug-ins, features, update sites (based on p2) and products. Combined with a continuous integration server, for example a Hudson or Jenkins instance, Tycho allows configuring an integration build for Eclipse components. Tycho uses the metadata of the Eclipse components files as much as possible, e.g., for plug-ins it determines the dependencies via theMANIFEST.MF
file.
The main Tycho Maven plug-in for is the tycho-maven-plugin
plug-in. This plug-ins supports building Eclipse projects, it enables Maven to understand package types such as eclipse-plugin, eclipse-feature and eclipse-repository.
To use Tycho you only have to install the Maven build tool. The Tycho plug-ins for Maven are automatically downloaded and installed by Maven based on your Maven configuration file.
安裝Maven#
Vogel: [Apache Maven tutorial]
Tycho 配置#
啟用Tycho-maven 插件##
啟用Tycho很簡單,把下面的properties和build標簽加入到parent pom文件即可
<properties>
<tycho-version>0.24.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
設置repository##
repository標簽用來設定一個Eclipse 官方p2倉庫,從這個倉庫可以獲取Tycho以及Eclipse插件或者OSGi模塊化開發所需的大量編譯好的模塊
<properties>
<repo.url.mars>http://download.eclipse.org/releases/mars</mars-repo.url>
</properties>
<repository>
<id>eclipse-mars</id>
<url>${repo.url.mars}</url>
<layout>p2</layout>
</repository>
Tycho構建
# switch to the directory of you plug-in
cd com.vogella.tycho.plugin1
# run build
mvn clean verify
參考&資源#
wiki:Tycho/Reference Card
Vogel:Eclipse Tycho for building Eclipse Plug-ins and RCP applications
maven&tycho
DEMO:Building Eclipse Plug-ins and RCP Applications with Tycho