当我为我的项目在pom.xml中添加对eXist-db工件的依赖时,一切都如我所期望的那样正常工作。下面是添加到pom中的片段:
<dependencies>
<dependency>
<groupId>org.exist-db</groupId>
<artifactId>exist-core</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>exist</id>
<url>https://raw.github.com/eXist-db/mvn-repo/master/</url>
</repository>
</repositories>但是,当我想使用Nexus (nexus-2.14.4-03)导入依赖项时,我很难让它正常工作。在我的项目的pom.xml中,我删除了存储库元素,使其通过Nexus存储库工作。
在Nexus中,我为eXist工件添加了新的代理存储库。而不是将存储库添加到公共存储库组中。此外,在maven的settings.xml中,我添加了如下镜像代码:
<mirror>
<id>nexus</id>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
<name>Nexus Repository.</name>
</mirror>Nexus存储库似乎可以工作。我可以从Nexus浏览它,将它看作Eclipse中的全局存储库,并在浏览器中检查它,其中包含工件列表,但eXist-db除外。
回到问题上。在Nexus中的eXist代理存储库设置中,当我将https://raw.github.com/eXist-db/mvn-repo/master/作为远程存储位置时,我有Remote Automatically Blocked and Unavailable消息。顺便说一下,该链接被重定向到https://raw.githubusercontent.com/eXist-db/mvn-repo/master/,并且从Nexus的wrapper.log文件中我有以下一行:
admin org.sonatype.nexus.proxy.maven.maven2.M2Repository - Remote peer of proxy repository "exist-db" [id=exist-db] threw a org.sonatype.nexus.proxy.RemoteStorageException exception. Connection/transport problems occured while connecting to remote peer of the repository. Auto-blocking this repository to prevent further connection-leaks and known-to-fail outbound connections until administrator fixes the problems, or Nexus detects remote repository as healthy. - Cause(s): Unexpected response code while executing GET method [repositoryId="exist-db", requestPath="/", remoteUrl="https://raw.github.com/eXist-db/mvn-repo/master/"]. Expected: "SUCCESS (200)". Received: 400 : Bad Request因此,当我试图将这个回购URL放到我要得到的web浏览器中时:400: Invalid request就像预期的那样。
我猜这不是Nexus中代理存储库的正确链接,因为Nexus需要该链接上的工件列表。因此,我将其更改为https://github.com/eXist-db/mvn-repo,Remote Automatically Blocked and Unavailable消息消失了。以下是日志中的行:
INFO [proxy-3-thread-24] admin org.sonatype.nexus.proxy.storage.remote.httpclient.HttpClientRemoteStorage - Updating remote transport for proxy repository "exist-db" [id=exist-db]...
WARN [proxy-3-thread-24] admin org.sonatype.nexus.proxy.maven.maven2.M2Repository - Remote peer of proxy repository "exist-db" [id=exist-db] detected as healthy, un-blocking the proxy repository (it was AutoBlocked by Nexus).
INFO [qtp16973920-132] admin org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration due to changes in [Public Repositories] made by admin...
INFO [ar-4-thread-1] admin org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl - Unpublished prefix file of "Public Repositories" [id=public] (and is marked for noscrape)
ERROR [qtp16973920-49] admin org.sonatype.nexus.rest.NexusRestletResource - java.lang.StringIndexOutOfBoundsException: String index out of range: -10
java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:935)
at java.lang.StringBuilder.substring(StringBuilder.java:76) ~[na:1.8.0_131]
at org.sonatype.nexus.plugins.rrb.parsers.HtmlRemoteRepositoryParser.getLinkUrl(HtmlRemoteRepositoryParser.java:173) ~[na:na]
...我试图从Nexus内部更新存储库索引,下面是该操作的日志行:
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.tasks.UpdateIndexTask - Scheduled task (UpdateIndexTask) started :: Updating repository index "exist-db" from path / and below.
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.DefaultIndexerManager - Trying to get remote index for repository "exist-db" [id=exist-db]
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.DefaultIndexerManager - Cannot fetch remote index for repository "exist-db" [id=exist-db] as it does not publish indexes.
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.NexusScanningListener - Scanning of repositoryID="exist-db" started.
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.NexusScanningListener - Scanning of repositoryID="exist-db" finished: scanned=0, added=0, updated=0, removed=0, scanningDuration=0:00:00.328
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.DefaultIndexerManager - Publishing index for repository exist-db
INFO [pxpool-1-thread-6] admin org.sonatype.nexus.index.tasks.UpdateIndexTask - Scheduled task (UpdateIndexTask) finished :: Updating repository index "exist-db" from path / and below. (started 2017-06-29T15:53:28+02:00, runtime 0:00:01.375)最后,在我的exist-db代理存储库的路由选项卡下的Nexus中,有:
Publishing:
Status: Not published.
Message: Discovery in progress or unable to discover remote content (see discovery status).
Discovery:
Status: Unsuccessful.
Message: No scraper was able to scrape remote (or remote prevents scraping).我在项目的pom.xml上获得了Eclipse中的错误消息,声明:
Missing artifact org.exist-db:exist-core:jar:3.2.0有人能告诉我我在这里错过了什么吗?谢谢。
发布于 2017-06-30 21:49:02
不幸的是,原始的GitHub回购只适用于mvn命令行工具。它不能作为Nexus代理的来源。
然而,我的公司维护一个公开的Nexus,其中包含最新的eXist工件:http://repo.evolvedbinary.com/content/repositories/exist-db/。
虽然上面的URL仍然有效,但我们现在已经更新到Nexus 3,它更喜欢现在应该从:http://repo.evolvedbinary.com/repository/exist-db/访问存储库的更新的URL样式。
https://stackoverflow.com/questions/44828352
复制相似问题