使用Eclipse Tycho構(gòu)建Eclipse Plugin項(xiàng)目

Eclipse Tycho簡(jiǎn)介#

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很簡(jiǎn)單,把下面的properties和build標(biāo)簽加入到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>

設(shè)置repository##

repository標(biāo)簽用來(lái)設(shè)定一個(gè)Eclipse 官方p2倉(cāng)庫(kù),從這個(gè)倉(cāng)庫(kù)可以獲取Tycho以及Eclipse插件或者OSGi模塊化開(kāi)發(fā)所需的大量編譯好的模塊

<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構(gòu)建

# 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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容