简体   繁体   English

Tycho不使用Eclipse中没有版本的eclipse-target-definition项目中的目标文件

[英]Tycho does not use target file from eclipse-target-definition project without version in the pom

I have a problem with the Maven/Tycho mechanism to resolve dependencies from a .target file. 我有Maven / Tycho机制来解决.target文件中的依赖项问题。 I followed the information on https://wiki.eclipse.org/Tycho/Target_Platform#Target_files , but do not get the expected results. 我遵循了https://wiki.eclipse.org/Tycho/Target_Platform#Target_files上的信息,但未获得预期的结果。 Here are some facts: 以下是一些事实:

Target file: 目标文件:

<target name="Eclipse Kepler Target" sequenceNumber="1424335573">
<locations>
    <location includeMode="slicer" includeAllPlatforms="false" includeSource="false" includeConfigurePhase="false" type="InstallableUnit">
        <unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.equinox.p2.sdk.feature.group"  version="0.0.0"/>
        <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.emf.validation.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.emf.workspace.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.emf.workspace.source.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.emf.eef.sdk-feature.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.draw2d.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.gef.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.acceleo.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.acceleo.source.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.ocl.feature.group" version="0.0.0"/>
        <unit id="org.eclipse.ocl.source.feature.group" version="0.0.0"/>
        <repository id="kepler" location="http://korvm016.apac.bosch.com/updatesites/thirdparty/eclipse_4.3_kepler/"/>
    </location>
    <location includeMode="slicer" includeAllPlatforms="false" includeSource="false" includeConfigurePhase="false" type="InstallableUnit">
        <unit id="com.google.inject" version="0.0.0"/>
        <unit id="com.google.inject.source" version="0.0.0"/>
        <unit id="com.google.inject.assistedinject.source" version="0.0.0"/>
        <unit id="com.google.inject.assistedinject" version="0.0.0"/>
        <unit id="com.google.inject.multibindings.source" version="0.0.0"/>
        <unit id="com.google.inject.multibindings" version="0.0.0"/>
        <unit id="com.google.guava" version="0.0.0"/>
        <unit id="com.google.guava.source" version="0.0.0"/>
        <unit id="javax.activation" version="0.0.0"/>
        <unit id="javax.activation.source" version="0.0.0"/>
        <unit id="org.aopalliance" version="0.0.0"/>
        <unit id="org.apache.commons.cli" version="0.0.0"/>
        <unit id="org.apache.commons.cli.source" version="0.0.0"/>
        <unit id="org.apache.commons.collections" version="0.0.0"/>
        <unit id="org.apache.commons.collections.source" version="0.0.0"/>
        <unit id="org.apache.commons.exec" version="0.0.0"/>
        <unit id="org.apache.commons.exec.source" version="0.0.0"/>
        <unit id="org.apache.commons.httpclient" version="0.0.0"/>
        <unit id="org.apache.commons.httpclient.source" version="0.0.0"/>
        <unit id="org.apache.commons.io" version="0.0.0"/>
        <unit id="org.apache.commons.io.source" version="0.0.0"/>
        <unit id="org.apache.commons.lang" version="0.0.0"/>
        <unit id="org.apache.commons.lang.source" version="0.0.0"/>
        <unit id="org.junit" version="0.0.0"/>
        <unit id="org.junit.source" version="0.0.0"/>
        <unit id="org.hamcrest.core.source" version="0.0.0"/>
        <unit id="org.hamcrest.core" version="0.0.0"/>
        <unit id="org.hamcrest.generator.source" version="0.0.0"/>
        <unit id="org.hamcrest.generator" version="0.0.0"/>
        <unit id="org.hamcrest.integration.source" version="0.0.0"/>
        <unit id="org.hamcrest.integration" version="0.0.0"/>
        <unit id="org.hamcrest.library.source" version="0.0.0"/>
        <unit id="org.hamcrest.library" version="0.0.0"/>
        <unit id="org.hamcrest.text.source" version="0.0.0"/>
        <unit id="org.hamcrest.text" version="0.0.0"/>
        <unit id="org.hamcrest" version="0.0.0"/>
        <unit id="org.mockito" version="0.0.0"/>
        <unit id="org.mockito.source" version="0.0.0"/>
        <unit id="org.objenesis" version="0.0.0"/>
        <unit id="org.objenesis.source" version="0.0.0"/>
        <unit id="ch.qos.logback.classic" version="0.0.0"/>
        <unit id="ch.qos.logback.classic.source" version="0.0.0"/>
        <unit id="ch.qos.logback.core" version="0.0.0"/>
        <unit id="ch.qos.logback.core.source" version="0.0.0"/>
        <unit id="ch.qos.logback.slf4j" version="0.0.0"/>
        <unit id="ch.qos.logback.slf4j.source" version="0.0.0"/>
        <unit id="org.slf4j.api" version="0.0.0"/>
        <unit id="org.slf4j.api.source" version="0.0.0"/>
        <repository id="orbit" location="http://korvm016.apac.bosch.com/updatesites/thirdparty/orbit-buildrepo-R20140525021250/"/>
     </location>
</locations>
</target>

The pom-File for the target module: 目标模块的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>
    <groupId>com.etas.congra.releng</groupId>
    <artifactId>com.etas.congra.releng.targetplatform</artifactId>
    <packaging>eclipse-target-definition</packaging>
</project>

I do not have a version in here, because I found a page in the web which told the story that a version in the pom for the eclipse-target-packaging does not work and in fact, specifying a version resulted in not resolving the following configuration in the parent pom used for all other maven modules: 我在这里没有版本,因为我在网络上找到一个页面,该页面讲述了故事,即pom中用于eclipse-target-packaging的版本不起作用,实际上,指定版本导致无法解决以下问题用于所有其他Maven模块的父pom中的配置:

<plugins>
<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>target-platform-configuration</artifactId>
    <version>${tycho-version}</version>
    <configuration>
        <target>
            <artifact>
                <groupId>com.etas.congra.releng</groupId>
                <artifactId>com.etas.congra.releng.targetplatform</artifactId>
                <relativePath>../../releng/com.etas.congra.releng.targetplatform/pom.xml</relativePath>
            </artifact>
        </target>
    </configuration>
</plugin>
</plugins>

With this in place I get the following error message during the maven build: 有了这个适当的位置,我在maven构建过程中收到以下错误消息:

[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.etas.congra.releng:com.etas.congra.log:0.1.0-SNAPSHOT @ D:\ConGra_IDE_Luna_win64\git\congra\plugins\com.etas.congra.log\pom.xml
[INFO] Resolving dependencies of MavenProject: com.etas.congra.releng:com.etas.congra.log:0.1.0-SNAPSHOT @ D:\ConGra_IDE_Luna_win64\git\congra\plugins\com.etas.congra.log\pom.xml
[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.etas.congra.log 0.1.0.qualifier
[ERROR]   Missing requirement: com.etas.congra.log 0.1.0.qualifier requires 'bundle ch.qos.logback.classic 1.0.7' but it could not be found
[ERROR]

It cannot resolve dependencies to artifacts from the target file, although the target works properly in the Eclipse workspace and if all repositories mentioned in the target files are expressed as repository tags in the pom file, the build also works. 尽管目标可以在Eclipse工作区中正常工作,并且如果目标文件中提到的所有存储库都在pom文件中表示为存储库标签,则它无法解决目标文件对工件的依赖关系。

Has anybody an idea what is wrong in my configuration? 有人知道我的配置有什么问题吗?

same question asked and answered on the tycho-user mailing list: tycho用户邮件列表上的相同问题:

https://dev.eclipse.org/mhonarc/lists/tycho-user/msg06323.html https://dev.eclipse.org/mhonarc/lists/tycho-user/msg06323.html

When you configure a target-platform-configuration artifact where either the groupId , artifactId , or version is missing, Tycho silently ignores this configuration. 当您配置缺少groupIdartifactIdversion的target-platform-configuration工件groupId ,Tycho会静默忽略此配置。 This is a bug in Tycho - it should fail with a clear error message instead. 是Tycho中的错误 -相反,它应该失败并显示明确的错误消息。

So you need to reference the eclipse-target-definition module with a version. 因此,您需要使用版本来引用eclipse-target-definition模块。 In case you have a project setup which uses the same version in every module, you can use ${project.version} for this (to avoid manual work when you are using the tycho-versions-plugin which currently doesn't update the target-platform-configuration ). 如果您有一个在每个模块中都使用相同版本的项目设置,则可以为此使用${project.version} (以避免在使用tycho-versions-plugin时手动工作,该插件 当前不更新目标-platform-configuration )。 If some of the projects which inherit the target-platform-configuration from your parent POM use a different version, you need to specify the target file with an explicit version. 如果从父POM继承了目标平台配置的某些项目使用其他版本,则需要使用显式版本指定目标文件。 (Background: Variables in POMs are expanded after inheritance, so ${project.version} expands to the version of the child project and not to the version of the parent POM containing the configuration.) (背景:POM中的变量在继承后被扩展,因此${project.version}扩展为子项目的版本,而不扩展为包含配置的父POM的版本。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM