Tycho基本POM配置

tycho资料太少了,所以去官网腾了一些翻译到博客上。水平有限,仅供学习交流。疏漏处望大神不吝赐教,谢谢。

官网地址:http://wiki.eclipse.org/Tycho/Reference_Card

连接到tycho

 <properties>
      <tycho-version>0.25.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>
通常定义在build或plugin的parent POM里面。

提供构建内容的仓库

声明一个用来获取预构建片段的仓库,可声明多个,同见目标文件部分。(译者注:1.翻译精确度存疑2翻译时eclipse版本为mars,可根据情况自行修改。)

  <repository>
      <id>eclipse-mars</id>
      <layout>p2</layout>
      <url>http://download.eclipse.org/releases/mars</url>
   </repository>


提供构建内容的目标文件

使用一个用来获取预构建片段的目标平台, 此目标平台文件可以通过eclipse PDE编辑器来编辑

  <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <target>
                <artifact>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <classifier>TargetFileNameWithoutExtension</classifier>
                </artifact>
              </target>
            </configuration>
          </plugin>

目标运行环境

声明软件构建的目标运行环境(比如不同的操作系统),这将决定了需要包含在项目依赖中的不同平台依赖。如果你遗漏此项,会报出:

 No explicit target runtime environment configuration. Build is platform dependent
代码如下:

 <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <environments>
            <environment>
              <os>win32</os>
              <ws>win32</ws>
              <arch>x86</arch>
            </environment>
            <environment>
              <os>linux</os>
              <ws>gtk</ws>
              <arch>x86_64</arch>
            </environment>
            <environment>
              <os>macosx</os>
              <ws>cocoa</ws>
              <arch>x86_64</arch>
            </environment>
          </environments>
        </configuration>
      </plugin>

Bundle, Fragments

(译者注:这两个鬼到底怎么翻译啊。。。。。。。。束,片段。。。)
 <groupId>Some-Group-Id</groupId>
  <artifactId>Bundle-SymbolicName</artifactId>
  <version>Bundle-Version</version>
  <packaging>eclipse-plugin</packaging>

Features

(译者注:特性。。。功能件。。。怎么翻译。。。)
 <groupId>Some-Group-Id</groupId>
  <artifactId>FeatureId</artifactId>
  <version>FeatureVersion</version>
  <packaging>eclipse-feature</packaging>

p2 repositories

(译者注:p2仓库。。。。)
 <groupId>Some-Group-Id</groupId>
  <artifactId>RepositoryName</artifactId>
  <version>Version</version>
  <packaging>eclipse-repository</packaging>

Products

 <groupId>Some-Group-Id</groupId>
  <artifactId>RepositoryName</artifactId>
  <version>Version</version>
  <packaging>eclipse-repository</packaging>
  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-p2-director-plugin</artifactId>
        <version>${tycho-version}</version>
        <executions>
          <execution>
            <id>materialize-products</id>
            <goals>
              <goal>materialize-products</goal>
            </goals>
          </execution>
          <execution>
            <id>archive-products</id>
              <goals>
                <goal>archive-products</goal>
              </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
(。。。。好多,不想腾了。。。以后有机会再编辑。直接拿出一个范例。)


parent POM

<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>org.eclipse</groupId>
	<artifactId>org.eclipse.equinox.p2-parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<properties>
		<tycho-version>0.25.0</tycho-version>
	</properties>
	<repositories>
		<repository>
			<id>helios</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/releases/helios</url>
		</repository>
		<repository>
			<id>galileoTest</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/eclipse/updates/3.6-JUnit-Tests/</url>
		</repository>
	</repositories>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>

			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<environments>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

bundle/fragment POM

<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>org.eclipse.equinox.p2-parent</artifactId>
		<groupId>org.eclipse</groupId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../org.eclipse.equinox.p2-parent</relativePath>
	</parent>
	<groupId>org.eclipse</groupId>
	<artifactId>org.eclipse.equinox.p2.director</artifactId>
	<version>2.0.0.qualifier</version>
	<packaging>eclipse-plugin</packaging>
</project>

Test bundle POM

<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>org.eclipse.equinox.p2-parent</artifactId>
		<groupId>org.eclipse</groupId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../org.eclipse.equinox.p2-parent</relativePath>
	</parent>
	<groupId>org.eclipse</groupId>
	<artifactId>org.eclipse.equinox.p2.tests</artifactId>
	<version>1.2.0.qualifier</version>
	<packaging>eclipse-test-plugin</packaging>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-surefire-plugin</artifactId>
				<configuration>
					<testSuite>org.eclipse.equinox.p2.tests</testSuite>
					<testClass>org.eclipse.equinox.p2.tests.AutomatedTests</testClass>
					<argLine>-Xmx512m</argLine>
					<appArgLine>-nl en</appArgLine>
					<bundleStartLevel>
						<bundle>
							<id>org.eclipse.equinox.ds</id>
							<level>1</level>
							<autoStart>true</autoStart>
						</bundle>
					</bundleStartLevel>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值