Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

How to configure Sonatype Nexus repository to download maven dependency?

How to configure Sonatype Nexus repository with Maven?

Automatic dependencies is one of the powerful feature of Apache maven and its one of the reason Maven is very popular in developer community. Maven resolve the dependent library from local repository which is again connected with central repository or remote repository. thus we can say that Maven has 3 kinds of repository concept.
  • Local repostory e.g $USER_HOME/.m2
  • Central repostory e.g http://repo.maven.apache.org/maven2/
  • Private repostory e.g Sonatype Nexus, Artifactory, Archiva etc.
The diagram shown below represent how maven resolve the dependendency.

High Level Interaction between Local Repository, Central Repository and Remote Repository.


Dependency Management using Local Repository, Central Repository and Remote Repository.

This is How maven interact with Repository!


This is a diagram which shows the define flow in which maven try to resolve the dependency.

Now, We have understood that Central rrepository is in built but next questions is, How to inform the maven about the location of remote repository? In order to configure maven with remote repostory, in our case SonaType Nexus, we need to configuring host machine setting.xml and projects pom.xml to use your Nexus repos.

Put this in your ~/.m2/settings.xml file. This will configure the credentials to publish to your hosted repos, and will tell your mvn to use your repo as a mirror of central:

And now configure your projects.

If you want only to download dependencies from Nexus, put this in the pom.xml:

and

Add the following at the end of setting.xml

<activeProfiles>

    <!–make the profile active all the time –>

    <activeProfile>nexus</activeProfile>

  </activeProfiles>

Reference

https://maven.apache.org/guides/mini/guide-mirror-settings.html

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

What is Sonatype and use cases of Sonatype?

What is Sonatype? Sonatype, previously known for the Nexus platform, is now a broad software supply chain management (SSCM) company with various solutions to secure and optimize…

Read More

How to upload the artifacts in Sonatype Nexus using Maven

Step 1 – Install and Configure Nexus Server Step 2 – [Nexus Server] Create a nexus role containing all required access of Nexus. Step 3 – [Nexus…

Read More

The nexus-webapp service is not installed – The specified service does

scmuser created the topic: The nexus-webapp service is not installed – The specified service does While installing Sonatype nexus in Windows 7, I get following error.. wrapper…

Read More

How to Install Sonatype Nexus installation using Docker?

Sonatype Nexus Repository Manager 2 Install a Docker Engine Installation Instructions can be found here – http://www.devopsschool.com/tutorial/docker/docker-install-and-configuration.html Download a Sonatype Nexus Image > docker pull sonatype/nexus For…

Read More

Install SonaType SonaType Community Version

Download & Install JDK 1.8 64 bit [code]# cd /opt/</div> <div># wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.tar.gz”</div> <div># tar xzf jdk-8u66-linux-x64.tar.gz[/code] 32 bit [code]# cd…

Read More

Inrtroduction of Sonatype Nexus

Sonatype Nexus: Manage Artifacts Sonatype Nexus sets the standard for repository management providing development teams with the ability to proxy remote repositories and share software artifacts. Download…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x