Maven Central Upstream Sources within Azure DevOps - maven

Is it possible to to add Maven Central as an upstream source for an artifact feed in Azure DevOps?
I am currently using Nexus as a proxy to Maven Central but I would like to migrate to Azure DevOps.
It looks like there is a request for the functionality, but I wasn't sure if someone was clever enough to solve it with a Maven plugin or something else.

Maven Central Upstream Sources within Azure DevOps
Indeed, add Upstream Sources for Maven feeds to proxy maven central or other maven repositories is also required by many other customers, check it from:
Add Upstream Sources for Maven feeds
And MS team are working on the underlying infrastructure required for Maven upstream sources now, and expect to deliver them early in 2019.
You can find this in the Azure DevOps Features Timeline 2019 Q1:
So, it will meet with us soon.
Besides, AFAIK, there is no such way or Maven plugin to resolve this issue at this moment.
Hope this helps.

Related

Setting up Azure DevOps as mirror cannot resolv certain plugins

We are trying to setup Azure DevOps cloud as our only end point when we are building our java artifacts through maven. We have set-up our feeds and created a single feed that will work as mirror for Maven Central Repository. When building the artifacts all dependencies are fetched without any issue. The problem starts when we are trying to invoke certain plugins e.g. the versions plugin. When we invoke it we get:
[ERROR] No plugin found for prefix 'versions' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/airmil/.m2/repository), centralCloud (https://pkgs.dev.azure.com/...)]
It happen also with other plugins such as help plugin but others seem to work fine e.g jaxws. When we remove the mirror configuration from the settings.xml everything works fine. We haven't extensive tested with plugins work and which don't.
The configuration of the feed is the default allowing upstream sources from the ones set default by Azure DevOps cloud.
Any ideas what cause this issue

Nexus can not access configured Proxy Repositories such as Maven Central

our company has a Maven Repository (Nexus Version 1.4.0 Open Source), this repository hosts company artifacts and also it configured with some proxy repositories (like Maven Central). now the problem is that Nexus can not access to some of the repositories including Maven Central. this is really frustrating.
in Nexus web interface the status of these broken repositories is : "In Service - Attempting to Proxy and Remote Unavailable".
I have no idea what to do.
Not really an answer but a couple thoughts that can lead to the solution:
Since January 2020 maven central moved to https - maybe you should configure nexus accordingly (see this blog post from sonatype)
There might be a network configuration (firewall or whatever) that restricts nexus to make a connection to the mvn central. Maybe its worth to consult with network / admin people.
Nexus itself must have logs - maybe you'll find some information there.

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.

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