- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我继承了一个使用 Maven Tycho 构建的大型 Eclipse 插件代码库。它有几个插件模块、两个功能、一个目标平台和一个更新站点。我使用 Java 已经很多年了,但是我对 Eclipse 插件开发和 OSGi 还是很陌生。
我发现其中一个插件模块(我们将其称为“核心”)有一个“lib”文件夹,其中包含一些第三方 jar。我最初认为原始作者只是懒惰,因为我希望看到那些使用 Maven 依赖项指定的人。后来我发现将 Maven 依赖项放入 Eclipse 插件非常重要,经过两个多星期的努力解决这个问题并在各种论坛上发布问题后,我仍然无法让它工作。我今天意识到我没有尝试过 SO 发布,所以我们开始吧。
在阅读了更多关于该问题的内容后,我得出结论,我需要定义一个新模块,我们称之为“maventhirdparty”,它在pom中声明那些第三方依赖项,然后使用“maven-bundle-plugin”来生成一个有效的 OSGi 包,然后我需要将新包声明为原始“核心”包的依赖项。
我已经完成了这一切。不幸的是,尽管生成的包和 list 对我来说看起来是正确的,但当 Tycho 尝试解决“核心”模块的依赖关系时,它只是说它找不到我声明的新包。我不知道如何生成任何额外的诊断,它只是说它找不到它。
所以,这里有一些输出和文件摘录。
这是来自构建:
[INFO] Resolving dependencies of MavenProject: com.cisco.yangide:com.cisco.yangide.core:1.1.1-SNAPSHOT @ /home/opnfv/git/yangide/plugins/com.cisco.yangide.core/pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.cisco.yangide.core 1.1.1.qualifier
[ERROR] Missing requirement: com.cisco.yangide.core 1.1.1.qualifier requires 'bundle com.cisco.yangide.maventhirdparty 1.1.1' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: com.cisco.yangide:com.cisco.yangide.core:1.1.1-SNAPSHOT @ /home/opnfv/git/yangide/plugins/com.cisco.yangide.core/pom.xml: See log for details -> [Help 1]
<artifactId>com.cisco.yangide.maventhirdparty</artifactId>
<packaging>bundle</packaging>
<version>1.1.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>org.mapdb</groupId>
<artifactId>mapdb</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-api</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-impl</artifactId>
<version>0.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>1.1.1</Bundle-Version>
<Embed-Dependency>
antlr4-runtime, mapdb, yang-model-api, yang-parser-impl
</Embed-Dependency>
<Export-Package>org.opendaylight.yangtools.*, org.antlr.*, org.mapdb.*</Export-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>jars</Embed-Directory>
<_failok>true</_failok>
<_nouses>true</_nouses>
</instructions>
</configuration>
</plugin>
</plugins>
Manifest-Version: 1.0
Bnd-LastModified: 1454085545792
Build-Jdk: 1.8.0_60
Built-By: opnfv
Bundle-ClassPath: .,jars/antlr4-runtime-4.0.jar,jars/mapdb-1.0.4.jar,jar
s/yang-model-api-0.6.1.jar,jars/yang-parser-impl-0.6.1.jar
Bundle-DocURL: https://www.opendaylight.org
Bundle-License: https://www.eclipse.org/legal/epl-v10.html
Bundle-ManifestVersion: 2
Bundle-Name: com.cisco.yangide.maventhirdparty
Bundle-SymbolicName: com.cisco.yangide.maventhirdparty
Bundle-Vendor: OpenDaylight
Bundle-Version: 1.1.1
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: antlr4-runtime, mapdb, yang-model-api, yang-parser-imp
l
Embed-Directory: jars
Embed-Transitive: true
Embedded-Artifacts: ...
Export-Package: ...
Import-Package: ...
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"
Tool: Bnd-3.0.0.201509101326
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.cisco.yangide.core
Bundle-SymbolicName: com.cisco.yangide.core;singleton:=true
Bundle-Version: 1.1.1.qualifier
Bundle-Activator: com.cisco.yangide.core.YangCorePlugin
Bundle-Vendor: Cisco Systems, Inc.
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core;visibility:=reexport,
org.eclipse.text,
org.eclipse.core.resources,
org.eclipse.core.filesystem,
com.cisco.yangide.maventhirdparty;bundle-version="1.1.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.cisco.yangide.core,
com.cisco.yangide.core.buffer,
com.cisco.yangide.core.dom,
com.cisco.yangide.core.indexing,
com.cisco.yangide.core.parser,
com.cisco.yangide.core.model,
org.antlr.v4.runtime
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target includeMode="feature" name="YANG IDE Target Platform" sequenceNumber="26">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.guava" version="15.0.0.v201403281430"/>
<unit id="com.google.guava.source" version="15.0.0.v201403281430"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rcp.sdk.id" version="4.5.1.M20150904-0015"/>
<unit id="org.eclipse.graphiti.feature.feature.group" version="0.12.1.v20150916-0905"/>
<unit id="org.sonatype.m2e.mavenarchiver.feature.feature.group" version="0.17.0.201502101659-signed-20150525172209"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="2.11.1.v20150806-0404"/>
<unit id="org.eclipse.emf.compare.source.feature.group" version="3.1.1.201509120604"/>
<unit id="org.eclipse.graphiti.feature.tools.feature.group" version="0.12.1.v20150916-0905"/>
<unit id="org.eclipse.graphiti.sdk.feature.feature.group" version="0.12.1.v20150916-0905"/>
<unit id="org.eclipse.emf.compare.feature.group" version="3.1.1.201509120604"/>
<unit id="org.eclipse.sdk.ide" version="4.5.1.M20150904-0015"/>
<unit id="org.eclipse.graphiti.sdk.plus.feature.feature.group" version="0.12.1.v20150916-0905"/>
<unit id="org.eclipse.m2e.sdk.feature.feature.group" version="1.6.2.20150902-0002"/>
<unit id="org.eclipse.emf.compare.ide.ui.feature.group" version="3.1.1.201509120604"/>
<unit id="org.eclipse.gef.feature.group" version="3.10.1.201508170204"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.6.2.20150902-0002"/>
<unit id="org.eclipse.gef.sdk.feature.group" version="3.10.1.201508170204"/>
<unit id="org.eclipse.jdt.feature.group" version="3.11.1.v20150904-0015"/>
<repository location="http://download.eclipse.org/releases/mars/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.sonatype.m2e.buildhelper.feature.feature.group" version="0.15.0.201206251206"/>
<repository location="https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.15.0/N/0.15.0.201206251206/"/>
</location>
</locations>
</target>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>com.cisco.yangide</groupId>
<artifactId>com.cisco.yangide.target-platform</artifactId>
<version>1.1.1-SNAPSHOT</version>
</artifact>
</target>
<environments>
<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>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
最佳答案
我与 Eclipse 合作多年,我遇到了与您描述的完全相同的问题。
问题是,tycho 不“只是”从 maven reactor 解决依赖关系,它实际上是从目标平台解决它们。您可能需要查看您的父 pom 文件以发现它,但很可能 tycho 已配置为使用您继承的确切目标平台。
它看起来像
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>org.example</groupId>
<artifactId>target-definition</artifactId>
<version>1.0.0-SNAPSHOT</version>
</artifact>
</target>
</configuration>
</plugin>
If some of your dependencies are not OSGi bundles or are not available in P2 update sites, SIMPLY define them in the p2-maven-plugin config, generate the site and make it available using jetty (or any other mechanism). Then add the URL of the exposed site to the target platform definition. In such a way you will have a consistent, manifest-first dependency management in Eclipse RCP project!
关于java - Maven Tycho 找不到我用 maven-bundle-plugin 创建的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35091186/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!