2

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.

milijan
  • 387
  • 4
  • 12
  • Looks like its broken see wontfix issue here: https://github.com/eXist-db/mvn-repo/issues/4 try create a site workaround suggested with https://github.com/eXist-db/mvn-repo as url like: https://books.sonatype.com/nexus-book/reference/_creating_a_site_repository.html – Revive Jun 29 '17 at 15:44
  • @Revive Thanks for this usefull info. – milijan Jul 03 '17 at 13:07

1 Answers1

2

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/

adamretter
  • 3,885
  • 2
  • 23
  • 43
  • Thanks for your answer. I really appreciate it. But that repo is not so public. I've got "Access Denied : Please login before attempting further requests." message when I try to access it through browser and "Remote Automatically Blocked and Unavailable" message from the Nexus. – milijan Jul 01 '17 at 15:52
  • Apologies, that was just a misconfiguration blip here. We have now fixed that and the repo is public again now. – adamretter Jul 02 '17 at 20:16
  • Thank you for investing your time to solve this issue. – milijan Jul 03 '17 at 12:33
  • I have an issue with this new repo which is exposed through the Nexus, but in attempt to solve it I removed Nexus as the repository and relied on the sole exist repository specifying it in projects pom: `existhttp://repo.evolvedbinary.com/content/repositories/exist-db/` And I got an error: `Failed to read artifact descriptor for org.exist-db.thirdparty.se.softhouse:jargo:jar:0.4.2-SNAPSHOT-7fa1d04` That artifact is not downloaded. When repository link is replaced with `https://raw.github.com/eXist-db/mvn-repo/master/`all is working. – milijan Jul 13 '17 at 09:44
  • The artifact does seem to be there - http://repo.evolvedbinary.com/content/repositories/exist-db/org/exist-db/thirdparty/se/softhouse/jargo/0.4.2-SNAPSHOT-7fa1d04/ Perhaps you need to run `mvn -U clean install` on your project? – adamretter Jul 14 '17 at 11:01
  • Because of limited space for comment I was not to precise and clear enough about the error: `.... Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.exist-db.thirdparty.se.softhouse:jargo-parent:pom:0.4.2-SNAPSHOT-7fa1d04` What is missing is [jargo-parent artifact](http://repo.evolvedbinary.com/content/repositories/exist-db/org/exist-db/thirdparty/se/softhouse/jargo-parent/) and only in repo.evolvedbinary.com‌​ repository - at least for me. – milijan Jul 15 '17 at 05:45
  • Apologies, that was indeed missing. It is now present. Should all work, let me know if you need anything else. – adamretter Jul 17 '17 at 01:13
  • Thanks for solving this. Everything is perfect now. I have another, this time off topic question, and I would really appreciate your answer. What is the best place for asking questions regarding development of java applications with exist and its api? Here or on the exist mailing list? – milijan Jul 22 '17 at 07:20
  • The mailing list is probably more responsive and better for discussions – adamretter Jul 24 '17 at 17:08