Does the maven central repo need to be added to %USER%/.m2/settings.xml? - maven

I'm trying to build a project with maven and I have a repository I'm pulling packages from which I've configured in the %USER%/.m2/settings.xml file. The problem is it's pulling the packages from that repository but not from the maven central repository.
My question is if I create a settings.xml file and add my own repository to it, do I then also need the maven central repo?

It's possible to configure Maven to retrieve from both a private Maven repository manager (Like Nexus, Artifactory or Achiva) and also download from Maven Central.
Personally I prefer to confgure my Maven repository manager to proxy Maven Central. Within Nexus I create a repository group that combines the Maven Central Proxy with my hosted repositories. In this way a single URL gives me all my project dependencies. This simplifies Maven client configuration.

Related

Install spring-boot-starter-parent and upload to nexus

I would like to install the spring-boot-starter-parent jar and upload it to my private nexus 3 repo. Then I hope to configure my project pom file to retrieve the dependency from there. How can i download spring-boot-starter-parent jar?
My intention is to set up this nexus repo so that future projects will pull depencies from this nexus repo (where this environment is not connected to the internet)
No need to upload in your nexus. You can configure proxy-repository:
A repository that proxies everything you download from Maven Central. Next time you download the same dependency, it will be cached in your Nexus.
Look at this for details
Need to do following configuration:
– create a private (hosted) repository for our snapshots
– create a private (hosted) repository for our releases
– create a proxy repository pointing to Maven Central
– create a group repository to provide all of these repos under a single URL
Another procedure:
If you want to upload list of jar then write gradle task to upload nexus repository. here you get details.

Maven internal Repository

I have internal nexus repository. I want to install plugins from internal repository, having the dependencies which I want to download from the central maven repository. I am new to maven and really struggling to do the required configuration.
Once you deployed your own plugins into a nexus repository (say "releases") add that repository into the Nexus Group that contains both maven central and your releases repository. Usually developers will only use one url (mirror configured in settings.xml) from nexus and deploy artifacts into a specific repository.
In addition you need to make sure to add the maven group id of your plugins into settings.xml in the pluginGroups section: https://maven.apache.org/settings.html#Plugin_Groups
That should already work.

Maven repository usage to download artifacts

I have added a repository to download artifacts and I have seen maven using that repository to download artifacts, but only for particular artifacts of that repository maven tries to download from mvn central repository. When I chek that artifact on added repository it's available. What could be the issue ? In which situations maven tries to download from central repository ?
Specific issues is highlighted in ,
Magnolia Demo project mvn build failed due to not able to fetch magnolia-setproperty-maven-plugin
All the Maven dependencies are first downloaded from your local repository, then if they are not found, Maven will try in any remote repository that you define in your POM file or the settings.xml and for last it will try to download from Maven Central.

Maven private internal repository

I have create a maven local depository using "Artifactory". I want to add project dependencies to this local repository(all dependencies in my local .m2 folder), can I do that with Artifactory?. If can, how can I do it?
The dependencies will be added to Artifactory on the first run of your maven project (they will be fetched from one of the remote repositories Artifactory come preconfigured with).

How to create the repository (role is repository manager)with nexus

i created a maven repository using nexus and upload the jars files.Same way how to upload the maven plugins to repository.i directly add the maven-complier-plugin,it is not working.it will gives some exception like org.apahce,parenet ,plexus ,codehaus required and org.apache.maven.lifecycle errors are geting..
i will not be maven central repository,only using commpany repository includes every in my repository jars and maven plug
plz help me i am first create the repository.
Did you specify a mirror in your settings.xml file? If you want to force all users to use your repo and not repo1.maven.org, you'll need to enforce that. Also, you probably want your nexus to proxy central so that any artifact you don't host will still be available once you setup the mirror to block all outside repos.

Resources