我是Maven和Tycho的新手,我希望我不会问一个愚蠢的问题。谢谢阅读!!只为Tycho插件创建必要的Eclipse RCP插件
我在一个大的Eclipse RCP项目,像这样的结构:
-plugin 1
| -pom.xml
-plugin 2
| -pom。 XML
-plugin 3
| -pom.xml
-plugin 4
| -pom.xml
-product 1
| -pom.xml
-product 2
| -pom.xml
-master
| -pom.xml
在我的情况下,产品1需要插件1和插件2在之前构建,产品2需要插件2,插件3和插件4在之前构建。
主pom.xml文件是所有插件和产品pom.xml文件的父项。当我在主pom.xml上运行mvn clean install
时,所有产品和插件都已正确构建。
当我运行产品1的pom.xml文件mvn clean install
,它需要插件1和2的插件(产品2个模拟)的内置的.jar档案
这里是我的问题。 是否有可能在不使用已经构建的.jar文件的情况下重建只有一个产品所需的插件,并且不会构建“太多”的插件?
在我而言,这将意味着,我想运行产品1 mvn clean install
,它应该建立也插件1和2的插件而不是插件3-4,而不是产品2
如果它可以帮助你,这里是我的项目样本的pom.xml文件:
主的pom.xml:
<?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>
<groupId>myGroupId</groupId>
<artifactId>master</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho.version>0.17.0</tycho.version>
</properties>
<modules>
<module>../plugin1</module>
<module>../plugin2</module>
<module>../plugin3</module>
<module>../plugin4</module>
<module>../product1</module>
<module>../product2</module>
</modules>
<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>Repository1</id>
<layout>p2</layout>
<url>url-to-a-p2-site-on-my-server</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>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<target>
<artifact>
<groupId>myGroupId</groupId>
<artifactId>myGroupId.target</artifactId>
<classifier>targetPlatform</classifier>
</artifact>
</target>
<environments>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
<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>
</environments>
<ignoreTychoRepositories>false</ignoreTychoRepositories>
</configuration>
</plugin>
</plugins>
</build>
</project>
plugin1的pom.xml:
<?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>master</artifactId>
<groupId>myGroupId</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../master/pom.xml</relativePath>
</parent>
<groupId>myGroupId</groupId>
<artifactId>plugin1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
产品1的pom.xml:
<?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>master</artifactId>
<groupId>myGroupId</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../master/pom.xml</relativePath>
</parent>
<groupId>myGroupId</groupId>
<artifactId>product1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<name>product 1 build</name>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<publishArtifacts>true</publishArtifacts>
</configuration>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
所有其他插件和产品的定义是模拟的。
谢谢!