Proxying maven central snapshots leads to "Remote disabled automatic routing" error in Nexus - maven

My project uses an open source framework I have written. The latest version of the framework is in maven central, but we need its latest snapshot version. The snapshot version can be found in https://oss.sonatype.org/content/repositories/snapshots/
We am using an installation Sonatype Nexus in the project as a mirror of everything (*). In Nexus I have defined a proxy-repository with repository-policy snapshot to the above link. The public repositories group contains that proxy-repository.
Unfortunately routing for that proxy-repository fails in Nexus with "Remote disabled automatic routing" and the build fails since it can't find the frameworks snapshot version in the repository.
How can I access a snapshot version of a framework stored in central via my Sonatype Nexus instance? According to https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7a.2.PublishSnapshots this should be possible.

In your proxy repository configuration is a "Repository Policy" drop down -> you need you choose "SNAPSHOT" there.

Related

Sonatype Nexus can't index IBM Maven repository

We're trying to proxy the IBM Maven repository on our company internal Sonatype Nexus. We added the repository address but the repo has not been populated even under direct request.
The Sonatype nexus' "Browse Index" tab is empty whereas the "Browse Remote" correctly shows the library tree. But when adding dependecies to a project's pom.xml file, the IDE says it cannot find the archetypes and the artifacts.
Is the IBM repository indexed? Is there something we're missing? We are using IBM RAD 9.5 and Sonatype Nexus™ 2.11.4-01
Many Maven repositories do not publish search indexes, they are entirely optional, and only used to support interactive search. They are not used by Maven for artifact retrieval. To see if the remote publishes a search index try retrieving ".index/nexus-maven-repository-index.properties" from it.
If Maven cont' download artifacts from the repository see here for information on how to diagnose the issue:
https://support.sonatype.com/hc/en-us/articles/213464518-Troubleshooting-Artifact-Download-Failures
Again, artifact download failures have nothing to do with search indexes.

Publishing licensed artifact to Maven Central Repository

I need to push our project API's (bundled jar) to Maven Central Repository. As Part of that,i have gone through this link . However, am quite confused whether our project is eligible to publish in maven central repo,
Our API is not open source. it need to distribute only to client who purchase from us. is Maven provides any restrictions to download jar only for specific user who has some key etc?
POM.xml is requesting for licensing information. ours is not open source, if we allowed to publish, what should be licensing content in pom.xml?
Why we have to give our repo information in pom.xml? we are using bitbucket and hence providing the repo url is not accessible for others. can we have dummy repo or it is mandatory?
Please help me out guys.
Everything you publish to maven central will be available to everyone in the world.
For your use case, you can consider hosting your own maven repository.
Check sonatype nexus, artifactory, archiva...
With your own repo, you can configure a password in your server. Then your clients will need to configure your server in their pom.xml or settings.xml to download your artifacts.

Maven Repositories for Spring Roo

My intent is to proxy Roo Maven repository with my local Nexus installation, so that it will contain Roo 1.2.0.RELEASE packages.
On http://static.springsource.org/spring-roo/reference/html/resources.html it is written that Roo builds are published on http://spring-roo-repository.springsource.org/release.
Unfortunately that link returns error NoSuchKey.
Is there some other Maven repository to get Roo packages from ?
Based on this Nexus ticket I solved my problem by:
create Proxy on Nexus for http://spring-roo-repository.springsource.org/release
add this repository into default "Public Repositories" group
Nexus will proxy requested artifacts and it will crate index of this artifacts, but it is not able to index the whole http://spring-roo-repository.springsource.org/release repository, because its index is not published. The reason of this problem is that it is hosted on Amazon S3 storage.
Create (in Nexus) a proxy repository with the remote storage location = http://spring-roo-repository.springsource.org/release
Then, add it to the public repositories group.

is weblogic-maven-plugin available from maven center repository?

When i run my maven build script i get
Plugin com.oracle.weblogic:weblogic-maven-plugin:2.9.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.oracle.weblogic:weblogic-maven-plugin:jar:2.9.1: Could not find artifact com.oracle.weblogic:weblogic-maven-plugin:pom:2.9.1 in central (http://repo1.maven.org/maven2)
But when i search in repository i can see it there http://search.maven.org/#search|ga|1|weblogic-maven-plugin
Why this plugin is not available?
As Oracle WebLogic is not an open source product, Oracle has decided not to publish their Maven plugins in the Maven Central repository (providing the sources for each published artifact has now become a requirement, according to the Maven Central Repository Usage Guide).
Until recently, the only way was to build and install the WebLogic JAR file into the local Maven cache.
Starting from 2015, Oracle has set up a Maven repository which can be accessed by anyone having a valid OTN account - see abarisone's answer.
From the early months of 2015 Oracle has at last made its Maven repository available for Continuous Integration purposes.
This means that you will be able to find not only all Oracle Database artifacts but also those related to Fusion Middleware, Oracle Service Bus, ADF and so on.
You can find more info reading this blog post.
Obviously you need to have a valid OTN account to log in, and the same is required to configure maven proxies and Nexus.
Once registered you will have access to the following link which explains all the instructions in order to configure the repository.
About Sonatype Nexus, you need at least version 2.11.2 to be able to add the Oracle repository, as reported here

Good configuration for Archiva?

We have recently decided to use Maven as build system. I'm responsible to migrate all the projects from Ant to Maven. We also decided to use Apache Archiva to configure an internal repository in the company.
I see that Archiva create two repositories by default (internal and snapshots). I also see that it configures the internal repository to proxy the central and java.net repositories.
Are there some best practices regarding Archiva configuration?
In the Archiva documentation, there is a possibility to configure Maven to use only the internal repository and then access the remote repository through the internal repository. What do you think about this option?
Thanks for your help
A Maven repository manager is essential to support Enterprise Maven development. The Maven installer is merely a bootstrap, running Maven for the first time downloads everything it needs from the Maven Central repository in order to compile your project.
The benefits of using a Maven repository aree documented elsewhere but I'll summarize:
Efficiency. Repository acts as a cache for Maven Central artifacts
Resilience. Repository protects against remote repository failures or lack of internet connection
Repeatability. Storing common artifacts centrally, avoids shared build failures caused by developers maintaining their own local repositories.
Audit. If all 3rd party libraries used by development come from a single entry point in the build process one can assess how often they're used (based on download log files) and what kinds of licensing conditions apply.
To that end I'd encourage you to use the following Archiva features:
Locking down to only use Archiva. Configure Maven clients download everything from Archiva.
Virtual repositories for each team. Configure all the remote repositories used by teams centrally in Archiva instead of leaving the details to the teams themselves.
PS
I use Nexus for my Maven repository management, but the same concepts apply.

Resources