Code Monkey home page Code Monkey logo

upload-download-artifactfromnexus's Introduction

spring-boot-hello

Pre-requisites:

- Install Java
- Install Git
- Install Maven
- Install Nexus

Install Java:

yum install java-1.8.0-openjdk-devel -y

Install Git:

yum install git -y

Install Apache-Maven:

wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar xvzf apache-maven-3.6.3-bin.tar.gz

vi /etc/profile.d/maven.sh
--------------------------------------------
export MAVEN_HOME=/opt/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin
--------------------------------------------

source /etc/profile.d/maven.sh
mvn -version

Steps to push artifacts to nexus:

  1. We need to modify with nexus url inside pom.xml Inside url we need to replace repository name

     <distributionManagement>
         <snapshotRepository>
             <id>nexus-snapshots</id>
             <url>http://100.26.240.37:8081/repository/maven-snapshots/</url>
         </snapshotRepository>
         <repository>
             <id>nexus-releases</id>
             <url>http://100.26.240.37:8081/repository/maven-releases/</url>
         </repository>
     </distributionManagement>
    
  2. The credentials of the server have to be defined in the global Maven setting.xml:

     <server>
         <id>nexus-snapshots</id>
         <username>admin</username>
         <password>admin123</password>
       </server>
     <server>
         <id>nexus-releases</id>
         <username>admin</username>
         <password>admin123</password>
       </server>
     </servers>
    
  3. Run below command to run and deploy to nexus repository

     mvn clean install
     mvn deploy
    

Now go and check whether artifact uploaded into nexus repository

Download artifacts from nexus repository

Run shell script with run time variables

Run time variables are,
  - groupid
  - artifactid
  - version
Optional parameters:
  - classifier
  - type

Syntax:

sh get_artifact_from_nexus.sh groupid artifactid version

Command to Run:

sh get_artifact_from_nexus.sh org.springframework gs-spring-boot 0.1.0

upload-download-artifactfromnexus's People

Contributors

cloudtechmasters avatar balu743 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.