How to download remote index in Nexus OSS 3.2? - maven

I successfully installed Nexus OSS 3.2, but I get no search results, for example for "junit". Also under Browse / Components / Maven Central are no components listed.
I found NEXUS-9563 with following answer:
This means that the search indexes from Central haven't been downloaded. Have you set "Download Remote Indexes" to "true" in the central proxy repository's configuration?
But I can't find an option "Download Remote Indexes" in Nexus OSS 3.2. See proxy settings for Maven Central:
I tried:
Button Rebuild index:
The Rebuild Index button allows you to drop and recreate the search index for the proxy repository, synchronizing the contents with search index. This button is only available for proxy repositories.
Task of type Publish Maven indexes:
Maven indexes can be used to download an index of available components to a client including a developer’s IDE, for example. The task publishes the index for all or a specific Maven repository.
but nothing downloaded the remote index.
How can I download the remote index of a proxy?

Nexus Repository Manager 3.2 does NOT support usage of remote index for searches (and other purposes) at all. If you want this feature I suggest to stick with Nexus Repository Manager 2 for now.

Related

Nexus 3.1.0-04 OSS - no artifacts/assets seen in repository/components

I am playing around with Nexus oss 3.1.0-04 OSS. I created a new maven style repository called test and it is proxying from http://repo1.maven.org/maven2/org/apache/maven; After setting this up, I tried to view the contents of test repository but there is nothing seen. I get a "no component found in repository". Why is this? What is that am missing? If I type the URL http://repo1.maven.org/maven2/org/apache/maven on a browser am able to see all its contents.
By default, the local proxy is empty. The best way to get components in is to build a maven project. Of course, make sure your maven settings are configured to point to Nexus - https://books.sonatype.com/nexus-book/reference3/maven.html#maven-sect-single-group).
I should also add, Nexus 3 provides a task for this: Publish Maven indexes
- Maven indexes can be used to download an index of available components to your repo, allowing users connecting to it to use the index to discover components. The task publishes the index for all or a specific Maven repository, hosted, group or proxy. This task will not populate the Browse UI, we intentionally did this so you only see what components and assets are available locally. More on the task here: https://books.sonatype.com/nexus-book/reference3/admin.html

Adding remote repository in artifactory

I had jcenter repository in my artifactory under remote repositories. Since some of the artifacts were missing such as qpid, I decided to delete jcenter and add it back. When I deleted the jcenter repository and added it back it didn't download any artifacts.
The repository tree structure looks like this
Before removing the jcenter repository it was like this.
Why it is not able to import any artifact? I can see the URL which is associated with it(http://jcenter.bintray.com/) has so many artifacts.
A remote repository in Artifactory serves as a caching proxy. This means that it downloads artifacts from the remote URL and cache them in Artifactory,
When you deleted the JCenter repository from Artifactory you deleted all cached artifacts.
After recreating the repository, your cache is empty. This is why, when browsing jcenter-cache, you see no artifacts. You can use the remote browsing capability in order to see which artifacts are available in the remote URL, but not currently caches
To re-populate the cache, you will need to download artifacts from the remote repository. Usually the best way to do it, is running your builds which are using this repository.
If the problem is that artifacts are not resolved at all from the remote repository, try the following:
Make sure the repository is configured correctly in Artifactory. Use the "Test" button to make sure that the URL is correct and you can reach the remote URL.
Check that your build tool is properly configured to use the repository you configured. One way of checking this, is by monitoring the Artifactory request log looking for requests from your build tool.
Deleting a repository is not a good practice when you are missing some dependencies. A better approach would be checking if they are available in the remote URL and downloading them into the cache. Artifactory has the option to perform a remote search in Bintray which can help you when looking for artifacts in JCenter.

How do I block redeployments to Sonatype Nexus OSSRH

We're deploying our open source libraries to the OSS instance of Sonatype Nexus (https://oss.sonatype.org/) using the nexus-staging-plugin. This works all fine and well. However, since we're using a build server I want to block an accidential re-deployment of an existing artifact id - as this is normally not suppoted by maven. However, the OSSRH happily accepts and updates an existing release. Is there any way to block this and make the build fail?
I know that Nexus can be configured to do that - it is just, that I don't have any permissions to reconfigure the OSSRH instance..
Is there any maven plugin which could check the repo first and fail in first place in case nexus/sonatype does not support this? I looked into the enforcer plugin but there isn't a rule available.
It is true that there is a staging rule in Nexus which prevents duplicate GAV's being staged, but it is not enabled on https://oss.sonatype.org. The reason for this is that some users stage artifacts repeatedly (creating multiple staging repositories) and then choose one of them for release based on testing results.
But the server at https://oss.sonatype.org is configured so that you cannot release the same artifacts twice. So if you have two staging repositories that contain the same artifacts you will only be able to release one of them.

Why Doesn't nexus index list snaphot jars?

Nexus index lists pom, zip, test.jar, sources.jar and docs.zip for my snapshot but doesn't list the jar artifact.
Nexus view of storage shows the jar
Maven users pulling deps from this instance regularly down the jar
Is there a way to get it to show in the search and index with a download link or is the default artifact unlisted on purpose (I guess because I should always access it via pom).
You can, it works for me :
I don't see the snapshot jars in the browse index tab, but I see them in browse storage tab, and I can also see them in my web browser, seeing something like this :
https://repository.apache.org/content/groups/snapshots/commons-beanutils/commons-beanutils/1.8.4-SNAPSHOT/
I use :
Sonatype Nexus™ Open Source Edition, Version: 1.9.2
Samuel and I discussed the issue in the other answer. It seems this is working as designed probably due to the transient nature of snapshots.
You can find the snapshot jars (or default artifacts) via the full url and by browsing the storage but they do not show up in the index or the web UI search.

Nexus - proxy repositories with no indexes?

I'm trying to add a proxy to a public repository (specifically camel-extra). However, I get the following error in my Nexus logs:
Cannot fetch remote index for repository camel-extra
and then further down:
The remoteURL we requested does not exists on remote server (remoteUrl="http://camel-extra.googlecode.com/svn/maven2/releases/.index/nexus-maven-repository-index.properties")
I've ensured that 'Download Remote Indexes' is 'True', repaired the index, updated the index, all to no avail. Browsing to the provided URL shows that the artifacts are there.
So if a repository doesn't have this file, is it not proxy-able through Nexus?
TIA,
Roy
UPDATE
Thanks for the answers everyone - was able to pull the artifacts without the index. Thanks again!
Repositories without indexes published will be still proxy-able thru Nexus (or any other MRM). Index is only a "topping" providing useful extras like searching the whole remote content, etc.
The index does not participate in proxy-ing at all, hence the lack of it on remote does not affect main functionality of Nexus at all: to proxy artifacts from remote repository.
From the nexus documentation, it appears that downloading an index is configurable.
The default for new proxy repositories
is enabled, but all of the default
repositories included in Nexus have
this option disabled.
You should disable the Downloading of Remote Index.
Yes, it is proxyable. Just try to download an artifact which is hosted in that repository. The indexes only affect searching and the index published in turn by Nexus.

Resources