milijan milijan - 1 year ago 102
Java Question

How to solve the issue of Nexus not finding artifacts from added repository for the exist-db database?

When I add dependency for the eXist-db artifacts inside my pom.xml for my project as explained on the official place for eXist artifacts everything works as expected. Here are the fragments added to the 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>


But than, when I want to use Nexus (nexus-2.14.4-03) for importing dependencies, I have trouble to make it work. In my project's pom.xml I have erased repositories element to make it work through the Nexus repository.

In Nexus I have added new proxy repository for the eXist-db artifacts. Than I have added that repository to the Public Repositories group. Also, inside maven's settings.xml I have added mirror code like this:

<mirror>
<id>nexus</id>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
<name>Nexus Repository.</name>
</mirror>


Nexus repository seems to work. I can browse it from the Nexus, see it as global repository from the Eclipse, and inspect it in the browser with list of artifacts in it, except the eXist-db.

Back to the question. In my proxy repository settings for eXist-db inside Nexus, when I put https://raw.github.com/eXist-db/mvn-repo/master/ as the Remote Storage Location, I have
Remote Automatically Blocked and Unavailable
message. Btw that link is redirected to the https://raw.githubusercontent.com/eXist-db/mvn-repo/master/ And from the wrapper.log file of Nexus I have this line:

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


So, when I try to put this repo URL inside the web browser I am getting:
400: Invalid request
as expected.

I guessed that is not the right link for the proxy repository in Nexus, because Nexus needs the list of artifacts on that link. So, I have changed it to the
https://github.com/eXist-db/mvn-repo
and the
Remote Automatically Blocked and Unavailable
message disappeared. These are the lines from the log:

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]
...


Than I tried to update repository index from inside the Nexus, and these are the log lines from that action:

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)


At the end, in Nexus under Routing tab for my exist-db proxy repository I have:

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).


And I got the error message in Eclipse on project's pom.xml stating:

Missing artifact org.exist-db:exist-core:jar:3.2.0


Could someone tell me please what I am missing here?
Thanks.

Answer Source

The raw GitHub repo unfortunately only works with the mvn command line tool. It won't work as a source for a Nexus repo proxy.

However, my company maintain a public Nexus repo which contains the latest eXist artifacts here: http://repo.evolvedbinary.com/content/repositories/exist-db/

Whilst the above URL is still valid, we have now updated to Nexus 3, which prefers a newer URL style The repository should now be accessed from: http://repo.evolvedbinary.com/repository/exist-db/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download