Day 38: Jenkins Part 15: Build and push to Nexus Artifactory using Jenkins Pipeline.

Day 38: Jenkins Part 15: Build and push to Nexus Artifactory using Jenkins Pipeline.

  • In my previous articles we had already installed the Nexus and we are going to use the same nexus.Configured the nexus credentials already in Jenkins.
  • Install Required Plugins: Installed already the reqired plugins for nexus, maven and git etc in Jenkins.
  • Create a new job in Jenkins as Pipeline Project as shown below:

  • Now write sample pipeline script as :

  • Build now the Pipeline

  • Now write the pipeline script just clone the repository stage with the git hub repository URL as shown below.We can generate this URL with the help of pipeline syntax.

  • Build and stage is success:

  • Now add one more stage as build the code as shown below:

  • Build now and its success:

  • Now add one more stage as Push to Nexus Repository as :

  • In pom.xl we need to mention the correct url for the nexus repository and screenshot as shown below:

  • Facing 401 unauthorized error even though after providing the proper credentials, may be issue with the Jenkins version and Nexus version compatibility or we have used nexus as open source may be causing this issue.

  • But this is the process we need to do to build and push to nexus artifactory using Jenkins Pipeline.

In next article , I will try to build and deploy to tomcat using Jenkins Pipeline.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了