使用Eclipse Tycho构建Eclipse Plugin项目

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文件即可

   
      0.24.0
   

   
      
         
            org.eclipse.tycho
            tycho-maven-plugin
            ${tycho-version}
            true
         
      
   

设置repository##

repository标签用来设定一个Eclipse 官方p2仓库,从这个仓库可以获取Tycho以及Eclipse插件或者OSGi模块化开发所需的大量编译好的模块

 
    http://download.eclipse.org/releases/mars
  


    eclipse-mars
    ${repo.url.mars}
    p2

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

你可能感兴趣的:(使用Eclipse Tycho构建Eclipse Plugin项目)