问题描述
我使用 Maven/Tycho
构建 Eclipse RCP 项目,使用 p2-maven-plugin
构建位于本地主机上的 p2 站点。在父 pom 上调用 mvn clean install
应该会构建所有模块并创建客户端产品 zip,但是在构建产品时会出现一些错误。
错误堆栈跟踪
[INFO] --- target-platform-configuration:0.22.0:target-platform (default-target-platform) @ SplClientProduct ---
[DEBUG] Configuring mojo org.eclipse.tycho:target-platform-configuration:0.22.0:target-platform from plugin realm ClassRealm[plugin>org.eclipse.tycho:target-platform-configuration:0.22.0,parent: sun.misc.Launcher$AppClassLoader@425224ee]
[DEBUG] Configuring mojo 'org.eclipse.tycho:target-platform-configuration:0.22.0:target-platform' with basic configurator -->
[DEBUG] (f) project = MavenProject: cz.tigra.spl:SplClientProduct:1.0.0 @ /tigra/SplClientProduct/pom.xml
[DEBUG] -- end configuration --
[DEBUG] Adding reactor project: MavenProject: cz.tigra.spl:cz.tigra.spl.client.feature:1.0.0-SNAPSHOT @ /tigra/cz.tigra.spl.client.feature/pom.xml
[INFO]
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) @ SplClientProduct ---
[DEBUG] Configuring mojo org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products from plugin realm ClassRealm[plugin>org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0,parent: sun.misc.Launcher$AppClassLoader@425224ee]
[DEBUG] Configuring mojo 'org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products' with basic configurator -->
[DEBUG] (f) flavor = tooling
[DEBUG] (f) project = MavenProject: cz.tigra.spl:SplClientProduct:1.0.0 @ /tigra/SplClientProduct/pom.xml
[DEBUG] (f) qualifier =
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@3a70dd47
[DEBUG] -- end configuration --
[DEBUG] No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from cz.tigra.spl.client.product 1.0.0 to cz.tigra.spl.client.feature.feature.group [1.0.0,1.0.1).; No solution found because the problem is unsatisfiable.]
[INFO] {osgi.ws=gtk,osgi.os=linux,osgi.arch=x86_64,org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: cz.tigra.spl.client.product 1.0.0
[ERROR] Missing requirement: cz.tigra.spl.client.product 1.0.0 requires 'cz.tigra.spl.client.feature.feature.group [1.0.0,1.0.1)' but it Could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SplMavenRelease ................................... SUCCESS [4.117s]
[INFO] target-platform ................................... SUCCESS [0.106s]
[INFO] cz.tigra.spl.client.feature ....................... SUCCESS [0.629s]
....
success
....
[INFO] SplAggregator ..................................... SUCCESS [0.007s]
[INFO] SplClientProduct .................................. FAILURE [0.279s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:50.453s
[INFO] Finished at: Mon May 24 11:36:53 UTC 2021
[INFO] Final Memory: 125M/1796M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) on project SplClientProduct: Execution default-publish-products of goal org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products Failed: Cannot resolve dependencies of MavenProject: cz.tigra.spl:SplClientProduct:1.0.0 @ /tigra/SplClientProduct/pom.xml: See log for details -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) on project SplClientProduct: Execution default-publish-products of goal org.eclipse.tycho:tycho-p2-publisher-plugin:0.22.0:publish-products Failed: Cannot resolve dependencies of MavenProject: cz.tigra.spl:SplClientProduct:1.0.0 @ /tigra/SplClientProduct/pom.xml
是的,我也看到了这个问题 - 产品无法看到名为 cz.tigra.spl:cz.tigra.spl.client.feature
的自定义(在我的项目定义中)功能。我的问题是如何告诉产品我的功能位于何处/或其 feature.xml
的路径在哪里(我说得对吗?)。
我的 p2 站点
父(主)pom.xml
位于根文件夹中
<?xml version="1.0" encoding="UTF-8"?>
<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>cz.tigra.spl</groupId>
<artifactId>SplMavenRelease</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<eclipse-repo.url>http://download.eclipse.org/releases/latest</eclipse-repo.url>
<tycho.version>0.22.0</tycho.version>
</properties>
<!-- p2 update or use target platform -->
<repositories>
<repository>
<id>p2-site</id>
<url>http://localhost:8080/site/</url>
<layout>p2</layout>
</repository>
</repositories>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<meminitial>128m</meminitial>
<maxmem>1024m</maxmem>
<compilerArgs>
<arg>-XX:MaxPermSize=256m</arg>
</compilerArgs>
</configuration>
</plugin>
<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>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<phase>package</phase>
<id>package-feature</id>
<configuration>
<finalName>${project.artifactId}_${unqualifiedVersion}.${buildQualifier}</finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<extraRequirements>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.swt.win32.win32.x86_64</id>
<versionRange>[0.0.0,5.0.0)</versionRange>
</requirement>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.swt.win32.win32.x86_64</id>
<versionRange>[0.0.0,5.0.0)</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
<!-- <pomDependencies>consider</pomDependencies>-->
<filters>
<!-- work around Equinox bug 348045 -->
<filter>
<type>p2-installable-unit</type>
<id>org.eclipse.equinox.servletbridge.extensionbundle</id>
<removeAll/>
</filter>
</filters>
<executionEnvironment>JavaSE-1.6</executionEnvironment>
<!-- more settings -->
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</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>
<target>
<artifact>
<groupId>cz.tigra.spl</groupId>
<artifactId>target-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
</artifact>
</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>plugin-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
<version>2.6.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<outputDirectory>xtend-gen</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.12.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>52.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<modules>
<module>target-platform</module>
<module>cz.tigra.spl.client.feature</module>
<module>SplAggregator</module>
<module>SplClientProduct</module>
<!-- <module>p2-site</module>-->
</modules>
</project>
SplAggregator 只是将所有项目模块与源代码聚合在一起。
目标平台 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>cz.tigra.spl</groupId>
<artifactId>SplMavenRelease</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>cz.tigra.spl</groupId>
<artifactId>target-platform</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-target-deFinition</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
和target-platform.target
文件
<?pde version="3.6"?>
<target name="target-platform" sequenceNumber="10">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true"
type="Installableunit">
<!-- this doesn't work,that's why it's commented -->
<!-- <unit id="cz.tigra.spl.client.feature" version="1.0.0.202105240921"/>-->
<!-- <repository location="localhost:8080/site/features/"/>-->
</location>
</locations>
<targetJRE
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<launcherArgs>
<vmArgs>-Xmx1024m</vmArgs>
<programArgs>-consoleLog</programArgs>
</launcherArgs>
</target>
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>cz.tigra.spl</groupId>
<artifactId>SplMavenRelease</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>cz.tigra.spl</groupId>
<artifactId>cz.tigra.spl.client.feature</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
产品的 pom.xml
和 SplClient.product
:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>SplMavenRelease</artifactId>
<groupId>cz.tigra.spl</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>cz.tigra.spl</groupId>
<artifactId>SplClientProduct</artifactId>
<version>1.0.0</version>
<packaging>eclipse-repository</packaging>
<name>SplClientProduct</name>
<properties>
<product.finalName>SPL</product.finalName>
<product.id>cz.tigra.spl.client.product</product.id>
<product.outputDirectory>${project.build.directory}/products/${product.id}/win32/win32/x86_64</product.outputDirectory>
</properties>
<repositories>
<repository>
<id>p2-site</id>
<url>http://localhost:8080/site/</url>
<layout>p2</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<executions>
<execution>
<id>materialize-products</id>
<phase>package</phase>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<!-- create zip file with the installed product -->
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="SPL" uid="cz.tigra.spl.client.product" id="cz.tigra.spl.client.product" application="cz.tigra.spl.client.application" version="1.0.0" useFeatures="true" includeLaunchers="true">
<aboutInfo>
<image path="/cz.tigra.spl.client/images/about/about.png"/>
<text>
text pro about se bere z messages.properties (lokalizovany)
</text>
</aboutInfo>
<configIni use="default">
<win32>/config.ini</win32>
</configIni>
<launcherArgs>
<programArgs>-data
@user.home/SPL@deployment.mode/workspace
-configuration
@user.home/SPL@deployment.mode/configuration
-clean</programArgs>
<vmArgs>-xms256M
-Xmx1024M
-XX:PermSize=64M
-XX:MaxPermSize=128M</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
<windowImages i16="/cz.tigra.spl.client/icons/16_16/spl.png" i32="/cz.tigra.spl.client/icons/32_32/spl.png"/>
<splash
location="cz.tigra.spl.client"
startupProgressRect="5,275,445,15" />
<launcher name="spl">
<solaris/>
<win useIco="true">
<ico path="/cz.tigra.spl.client/images/logo/logo.ico"/>
<bmp/>
</win>
</launcher>
<vm>
</vm>
<plugins>
</plugins>
<features>
<feature id="cz.tigra.spl.client.feature" version="1.0.0.qualifier"/>
</features>
<configurations>
<plugin id="cz.tigra.spl.client" autoStart="true" startLevel="0" />
...
custom plugins deFinition
...
<plugin id="cz.tigra.spl.core" autoStart="true" startLevel="2" />
<plugin id="org.springframework.osgi.extender" autoStart="true" startLevel="1" />
</configurations>
</product>
所以我想在 p2 站点上放置 cz.tigra.spl.client.feature
是不够的,因为产品无法看到它 - 它应该在哪里?或者项目设置需要改变什么?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)