我是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>
所有其他插件和產品的定義是模擬的。
謝謝!