有一个Eclipse RCP/IDE插件项目依赖于几个Eclipse模块,如org.eclipse.e4.core.di
或org.eclipse.core.runtime
。eclipse RCP maven/tycho缺少需求'包org.eclipse.e4.core.di'
该项目在提交者环境的Eclipse IDE中进行编译,并使用.target
文件进行依赖关系设置。
我想添加一个无头的行家/第谷建立该项目导致的错误如下:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.myplugin.someservice 1.0.0
[ERROR] Missing requirement: org.myplugin.someservice 1.0.0 requires 'bundle org.eclipse.e4.core.di 0.0.0' but it could not be found
项目设置是这样的:
releng/
org.myplugin.releng/
pom.xml (contains tycho-plugins def, modules, target ref)
org.myplugin.target/
Neon.target
pom.xml (contains 'eclipse-target-definition')
plugins/
org.myplugin.someservice/
pom.xml
META-INF/
MANIFEST.MF (contains reference to org.eclipse.e4.core.di)
我使用教程来自Lars Vogel(http://www.vogella.com/tutorials/EclipseTycho/article.html#exercise-using-a-target-platform-for-the-build)的基础设置和理解。
目标文件的内容是:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="Neon" sequenceNumber="43">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.platform.sdk" version="4.6.3.M20170301-0400"/>
<unit id="org.eclipse.pde.feature.group" version="3.12.3.v20170301-0400"/>
<unit id="org.eclipse.pde.source.feature.group" version="3.12.3.v20170301-0400"/>
<unit id="org.eclipse.platform.ide" version="4.6.3.M20170301-0400"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.12.0.v20170209-1843"/>
<unit id="org.eclipse.rcp.feature.group" version="4.6.3.v20170301-0400"/>
<repository location="http://download.eclipse.org/eclipse/updates/4.6"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.emf.cdo.epp.feature.group" version="4.5.0.v20160607-1511"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="2.12.0.v20160526-0356"/>
<unit id="org.eclipse.emf.compare.diagram.papyrus.feature.group" version="3.2.1.201608311750"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="2.10.0.v201605250459"/>
<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.10.0.201606071959"/>
<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.10.0.201606071631"/>
<unit id="org.eclipse.uml2.sdk.feature.group" version="5.2.3.v20170227-0935"/>
<unit id="org.eclipse.emf.compare.ide.ui.feature.group" version="3.2.1.201608311750"/>
<repository location="http://download.eclipse.org/releases/neon"/>
</location>
</locations>
</target>
这捕获大多就是我的Eclipse安装信息打印出已安装软件有关。
的target/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>
<groupId>org.myplugin</groupId>
<artifactId>org.myplugin.releng</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../org.myplugin.releng/pom.xml</relativePath>
</parent>
<groupId>org.myplugin</groupId>
<artifactId>org.myplugin.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-target-definition</packaging>
</project>
的releng/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>
<parent>
<groupId>org.myplugin</groupId>
<artifactId>org.myplugin.releng</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../org.myplugin.releng/pom.xml</relativePath>
</parent>
<groupId>org.myplugin</groupId>
<artifactId>org.myplugin.someservice</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
我在这里计算器看过不少类似的问题,并试图许多修复:
- 删除版本tag target/pom.xml,
- 删除相对路径
- 使用pom代替eclipse-target-definition
- 和更多
没有工作。那么我在这里错过了什么?
编辑: 据我了解releng/pom.xml
应设置tycho插件和maven的东西。然后执行命令mvn clean verfiy
要构建解决方案,而在releng/pom.xml
指定Neon.target定义采用target/pom.xml
和target/Neon.target
获得Eclipse环境(包括org.eclipse.e4.core.di
,并org.eclipse.core
东西),加上任何进一步明确相关性。
EDIT2: 我eclipse-target-definition
插件配置是这样的:
<profile>
<id>Neon.target</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<xtext-version>2.10.0</xtext-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<includePackedArtifacts>true</includePackedArtifacts>
<target>
<artifact>
<groupId>org.myplugin</groupId>
<artifactId>org.myplugin.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
<classifier>org.myplugin.target</classifier>
</artifact>
</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
EDIT3:我使用的是第谷1.0版。0
EDIT4修复了target/pom.xml
中的错字。
你可以在Eclipse * Target Editor *中打开你的'Neon.target'。等到Eclipse解决了目标平台,然后仔细检查* Contents *标签,确定org.eclipse.e4.core.di是否确实包含在目标平台中。 –
好的,你的'Neon.target'确实**包含'org.eclipse.e4.core.di'(只是双重检查自己)。但是,你的'org.myplugin.someservice'插件是否在你的'pom中配置了[target-platform-configuration](https://wiki.eclipse.org/Tycho/Target_Platform#Target_files)Maven插件。 xml'(或其父母之一)? –
我将目标平台配置插件的配置附加为EDIT2。该配置位于org.myplugin.releng的父pom.xml中。 – justwellbrock