【问题标题】:maven Could not find artifact org.cytoscape:maven 找不到工件 org.cytoscape:
【发布时间】:2018-05-08 13:12:57
【问题描述】:

我正在尝试在我的公司内部通过代理构建这个 maven 项目 https://github.com/gsummer/cyNeo4j

Pom 中列出的依赖项在 Maven Central 存储库中不存在。 它们位于此处:

<repositories>
    <repository>
        <id>cytoscape_snapshots</id>
        <snapshots>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
        <name>Cytoscape Snapshots</name>
        <url>http://code.cytoscape.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>cytoscape_releases</id>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
        </releases>
        <name>Cytoscape Releases</name>
        <url>http://code.cytoscape.org/nexus/content/repositories/releases/</url>
    </repository>
</repositories>

我收到此错误

[错误] 无法在项目 cyneo4​​j 上执行目标:无法解析项目的依赖项 nl.maastrichtuniversity.networklibrary:cyneo4​​j:bundle:1.3dev:无法解析以下工件:org. cytoscape:service-api:jar:3.1.1, org.cytoscape:swing-application-api:jar:3.1.1, org.cytoscape:session-api:jar:3.1.1, org.cytoscape:work-api: jar:3.1.1, org.cytoscape:work-swing-api:jar:3.1.1, org.cytoscape:viewmodel-api:jar:3.1.1, org.cytoscape:layout-api:jar:3.1.1:在 nexus (http://our_host_nexus/nexus/content/groups/public/) 中找不到工件 org.cytoscape:service-api:jar:3.1.1 -> [帮助 1]

在我的设置 xml 中,

我已经添加了

<mirrors>
    <!-- mirror | Specifies a repository mirror site to use instead of a given 
        repository. The repository that | this mirror serves has an ID that matches 
        the mirrorOf element of this mirror. IDs are used | for inheritance and direct 
        lookup purposes, and must be unique across the set of mirrors. | -->
    <mirror>
          <id>nexus</id>
                        <mirrorOf>*,!cytoscape_releases,!cytoscape_snapshots</mirrorOf>
          <name>Our Local Nexus Repo</name>

        <url>our_nexus_host/nexus/content/groups/public/</url>

</mirror>

还有服务器标签:

  <server>
        <id>deployment</id>
        <username>admin</username>
        <password>password</password>
    </server>

然后我有另一个错误“拒绝访问”:

[错误] 无法在项目 CyPlugin 上执行目标:无法解析项目 GraphSYSBIO:CyPlugin:bundle:1.0-SNAPSHOT 的依赖项:无法在 org.cytoscape:vizmap-api:jar:3.6.1 收集依赖项:失败读取 org.cytoscape:vizmap-api:jar:3.6.1 的工件描述符:无法将工件 org.cytoscape:vizmap-api:pom:3.6.1 从/到 cytoscape_releases (http://code.cytoscape.org/nexus/content/repositories/releases/) 传输:访问拒绝: http://code.cytoscape.org/nexus/content/repositories/releases/org/cytoscape/vizmap-api/3.6.1/vizmap-api-3.6.1.pom,ReasonPhrase:禁止。 -> [帮助 1]

我被屏蔽了。

我唯一能想到的就是手动添加依赖项。但我想避免这种情况,因为我们可能会多次切换到多个依赖项版本。

【问题讨论】:

  • 最简单的方法是让您的 Nexus 管理员将 cytoscape 存储库作为代理存储库添加到您的公司 Nexus,然后将其添加到公共组。那你什么都不用做。工件将通过公司 Nexus 解决和交付。

标签: maven dependencies nexus cytoscape


【解决方案1】:

可以通过互联网访问dependency。因此访问被拒绝错误意味着您公司的代理不允许maven通过。

您应该在 settings.xml 中启用company proxy

<proxy>
  <id>example-proxy</id>
  <active>true</active>
  <protocol>http</protocol>
  <host>proxy.example.com</host>
  <port>8080</port>
  <username>proxyuser</username>
  <password>somepassword</password>
</proxy>

【讨论】:

  • 您好,感谢您的回复。我已经有了......但仍然没有运气
  • 嘿 werner..我仔细检查了我的代理..确实我得到了错误的代理主机。现在可以了,谢谢!!
猜你喜欢
  • 1970-01-01
  • 2017-08-21
  • 2016-12-27
  • 1970-01-01
  • 2011-01-24
  • 2018-06-23
  • 1970-01-01
  • 2021-10-16
  • 2018-02-21
相关资源
最近更新 更多