如何使用 Nexus Repository Manager 配置 P2 代理?

How to configure P2 proxy with Nexus Repository Manager?

我尝试使用 Nexus Repository Manager OSS 2.14 作为某些 Eclipse P2 存储库的代理,但无法正常工作。

我关注了Documentation Nexus Repository Manager 2.14

Nexus Repository Manager Pro has P2 support installed by default. Prior to any usage in Nexus Repository Manager OSS the Nexus P2 Bridge Plugin and the Nexus P2 Repository Plugin need to be installed. You can download the bundle.zip files for your specific version from the Central Repository:

  • Nexus P2 Repository Plugin
  • Nexus P2 Bridge Plugin

Extract the two files into sonatype-work/nexus/plugin-repository and restart the repository manager.

并安装了这两个插件。

要创建一个新的代理 P2 存储库,我遵循 Documentation Nexus Repository Manager 2.14:

  1. Click Repositories in the Views/Repositories menu.
  2. Click the Add.. button above the list of repositories, and choose Proxy Repository from the drop-down of repository types.

  3. In the New Proxy Repository window,

    a. Select P2 as the Provider.
    b. Supply a Repository ID and a Repository Name.
    c. Enter the URL to the remote P2 repository as the Remote Storage Location.
    d. Click Save.

按照 Nexus Repository Manager - Tutorial 作为测试,我使用 Nexus 的存储库 URL 安装了 Eclipse PMD 插件,并且运行良好。

但是我看不到插件存储的二进制文件,只能看到元数据。

如果我查看目录,我只看到元数据:

我的二进制文件在哪里?我是不是做错了什么?

我找到了原因:插件已经在bundle pool:

Bundle pooling

Prior to p2, each Eclipse application had its own private plugins directory where the application's software was kept. This had the drawback that systems with two or more Eclipse-based applications installed ended up with significant duplication of software and other artifacts. Furthermore, the common pieces had to be upgraded separately for each application, often resulting in slow downloads of software already available elsewhere on the local system.

To escape from this duplication problem, p2 natively supports the notion of bundle pooling. When using bundle pooling, multiple applications share a common plugins directory where their software is stored. There is no duplication of content, and no duplicated downloads when upgrading software.

所以 Eclipse 没有从 Nexus 下载二进制文件。它只下载元数据。

从捆绑池中删除插件(在 <USER_HOME>/.p2/pool 下)解决了我的问题。重新安装插件后,Nexus 得到了二进制文件。