我正在尝试在代理后面的公司内部构建这个maven项目 https://github.com/gsummer/cyNeo4j
Pom中列出的依赖项在Maven Central repo中不存在。 它们位于:
<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>
我收到此错误
[错误]无法在项目cyneo4j上执行目标:无法解析项目的依赖关系 nl.maastrichtuniversity.networklibrary:cyneo4j: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:找不到工件org.cytoscape:service-api:jar:3.1.1 in nexus(http://our_host_nexus/nexus/content/groups/public/) - &gt; [帮助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>
然后我又出现了另一个错误&#34;访问被拒绝&#34;:
[错误]无法在项目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 from / to 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:禁止访问。 - &GT; [帮助1]
我被封锁了。
我唯一能想到的是手动添加依赖项。但我想避免这种情况,因为我们可能会多次切换到多个依赖项版本。
答案 0 :(得分: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>