简体   繁体   English

使用来自 Nexus 中镜像 P2 存储库的 Tycho 构建 Eclipse 插件

[英]Building Eclipse plugin with Tycho from mirrored P2 Repository in Nexus

After endless reading and testing out different things, I now have to ask my specific question.在无休止地阅读和测试不同的东西之后,我现在不得不问我的具体问题。

A few information about my project: I would like to build a Eclipse plugin with Maven to integrate it in our CI/CD process.关于我的项目的一些信息:我想用 Maven 构建一个 Eclipse 插件,以将其集成到我们的 CI/CD 流程中。 We're using Eclipse-2019-06.我们正在使用 Eclipse-2019-06。 I'm in a separate developing network where I only have access to the internet via proxy.我在一个单独的开发网络中,我只能通过代理访问互联网。 A Nexus is running which is mirroring all the needed Maven repositories (Central and so).一个 Nexus 正在运行,它正在镜像所有需要的 Maven 存储库(中央等)。

Because of the proxy problem I installed the P2 Nexus plugin and bridge to add the Eclipse P2 repository https://download.eclipse.org/releases/2019-06/201906191000/ in our Nexus to mirror it locally. Because of the proxy problem I installed the P2 Nexus plugin and bridge to add the Eclipse P2 repository https://download.eclipse.org/releases/2019-06/201906191000/ in our Nexus to mirror it locally. So the Nexus repository points now from the official P2 download site to the localhttp://nexus:8081/nexus/content/repositories/eclipse-repository address.所以 Nexus 存储库现在从官方 P2 下载站点指向本地http://nexus:8081/nexus/content/repositories/eclipse-repository地址。

The first thing I tried then, was to add the update sitehttp://nexus:8081/nexus/content/repositories/eclipse-repository to the running Eclipse installation to access all the plugins and so on.我尝试的第一件事是将更新站点http://nexus:8081/nexus/content/repositories/eclipse-repository添加到正在运行的 Eclipse 安装以访问所有插件等。 This works fine!这很好用!

So now I'm trying to build the official Eclipse Plugin Tycho demo itp01 from https://github.com/eclipse/tycho-demo .所以现在我正在尝试从https://github.com/eclipse/tycho-demo构建官方的 Eclipse Plugin Tycho demo itp01。

And here comes the problem: I changed the repositories section in the official pom.xml to问题来了:我将官方 pom.xml 中的存储库部分更改为

 <repositories>
   <repository>
     <id>eclipse-repo</id>
     <layout>p2</layout>
     <url>http://nexus:8081/nexus/content/repositories/eclipse-repository</url>
   </repository>
 </repositories>here

When I now try to build the itp01 project I get the so often seen error:当我现在尝试构建 itp01 项目时,我得到了常见的错误:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: tycho.demo.itp01 1.0.0.qualifier
[ERROR]   Missing requirement: tycho.demo.itp01 1.0.0.qualifier requires 'osgi.bundle; org.eclipse.core.runtime 3.15.300' 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: tycho.demo.itp01:tycho.demo.itp01:1.0.0-SNAPSHOT @ /home/frto100/git/org.eclipse.tycho-demo/itp01/tycho.demo.itp01/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

It looks like it's not possible for Tycho to read the artifacts from the P2 repository in Nexus. Tycho 似乎无法从 Nexus 的 P2 存储库中读取工件。 Secondhand I'm not sure if Tycho even evaluates the given repository URL.二手我不确定第谷是否甚至评估给定的存储库 URL。 Is it possible to check if Tycho is really using the correct URL?是否可以检查 Tycho 是否真的使用了正确的 URL?

Can somebody maybe give me a hint where the problem could be?有人可以给我一个提示问题可能出在哪里吗? Or maybe somebody already solved this problem.或者也许有人已经解决了这个问题。

Thanks so much!非常感谢!

If you are using Maven 3.6.1 (which is embedded in Eclipse 2019-06 and 2019-09), you probably ran into the following issue:如果您使用的是 Maven 3.6.1(嵌入在 Eclipse 2019-06 和 2019-09 中),您可能会遇到以下问题:

Using a different Maven version than 3.6.1 should solve the issue.使用与 3.6.1 不同的 Maven 版本应该可以解决问题。

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

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