Why Doesn't nexus index list snaphot jars? - maven

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.

Related

Artifactory - Problems with overit-central and This item is not cached

We've been experiencing problems with our overit-central repository on Artifactory. Some elements appear as "not-cached" and while trying to retrieve them from a build, we're encountering an "element not found" error. That same element does exist in the overit-central repo, but somehow our Artifactory instance doesn't seem to find it or cache it. (The problem doesn't happen with all the elements of the repo, and we don't know why. Some of them are actually cached)
We've already run a re-index of said repository but still the "This item is not cached" continues to appear.
We tried creating a new remote repository hooked to the same url and running some maven re-indexes from Artifactory, but it didn't help.
How do we force the caching of the elements from Artifactory? The documentation in the JFrog support page mentions it, but doesn't explain how to do it.
Thank you in advance
Regards
A remote repository in Artifactory is a mirror of the endpoint you have configured. It doesn't download the artifacts by default and this is the reason it says "Artifact is not cached". It is the intended behavior and it lets you know that you have never downloaded this artifact.
In order to cache an artifact, you have to simply download it from the remote endpoint. This can be done in two ways:
From the UI - Right click --> download
Using the API "curl -uUSERNAME:PASSWORD http://ARTIFACTORY_URL:PORT/artifactory/REMOTE_REPOSITORY/PATH_TO_ARTIFACT
Once the artifact is downloaded, it means that it is cached and you will be able to see it in the "name-of-the-remote-repository-cache" repository which shows the downloaded cached artifacts.

How to download remote index in Nexus OSS 3.2?

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.

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

Nexus index loses artifact after deploy

I have a nexus repo (v2.1.2) where I deploy osgi bundles created with the maven-bundle-plugin. By default, the nexus index doesn't include packages of type bundle, so if i do a search for a bundle, I only get a reference to the pom, not the bundle (jar).
However, following this entry, I managed to make it work correctly. Here is what I added to /usr/local/sonatype-work/nexus/conf/packaging2extension-mapping.properties
bundle=jar
If after the change I do a rebuild index as suggested in the article, now the index contains the bundles. However, my problem is that when i redeploy a new snapshot of one of the bundles, it disappears from the index. The only way to get it back is by recreating the index one more time. Obviously at this point the whole workflow is unusable: i can't manually recreate the index after every deploy.
Is this a known issue? a bug? a misconfiguration?
Any ideas how to fix it?
I'm using the REST api to do queries so losing the artifacts from the index is pretty bad
It is a bug
There was a ticket opened for it
https://issues.sonatype.org/browse/NEXUS-5525

Maven + Hudson + Nexus: Access to SNAPSHOT Build Number

Now that Maven3 has dropped support for setting uniqueVersion=false on deployment, I'm running into an issue. I have Hudson do an automatic deployment of my SNAPSHOT build to my Nexus repository manager. The resulting SNAPSHOT artifact looks like blah-0.0.1-20110517.233746-1.jar. Note the unique SNAPSHOT build id. The trick is that I'd link to that jar in my site documentation, but I'm not sure how to inject that snapshot build number into the docs. Perhaps there is a way to have Maven or Hudson or Nexus create a symlink on deployment from blah-0.0.1.jar => blah-0.0.1-20110517.233746-1.jar?
Ok, mod me down, but I think I found an answer to my own question. I'm posting here in case anyone else finds it useful.
It turns out the Nexus REST api has the ability to automatically retrieve the latest SNAPSHOT build of an artifact, which is exactly the functionality I needed. For more info, see:
https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.HowcanIretrieveasnapshotifIdon%27tknowtheexactfilename%3F

Resources