简体   繁体   English

Jenkins Maven Nexus,如何学习?

[英]Jenkins Maven Nexus, how to learn it?

TASK: I was charged to make/test CI pipeline for any Java (Maven preferably) sources in Jenkins (all Devops tools must be in Docker containers) . 任务:我负责为Jenkins中的任何Java(最好是Maven)源制作/测试CI管道(所有Devops工具必须位于Docker容器中)。 I need to do basic stages : 我需要做一些基本的步骤:

  • 1) Get source from github - done (I did by creating task in Jenkins and used example java app from some github repo) 1)从github获取源代码-完成(我通过在Jenkins中创建任务并从某些github存储库中使用示例Java应用程序来完成)

  • 2) Build in Maven - done 2)在Maven中构建-完成

  • 3) Make Junit tests - done 3)做Junit测试-完成

  • 4) Push artifacts ( .war file probably) to Nexus 3 repository - need to solve 4)将工件(可能是.war文件)推送到Nexus 3存储库-需要解决

HOW I tried to SOLVE: I've found the docker-ci-tool-stack ( "Devops-ready" platform: Jenkins, SonarQube, Nexus, GitLab) , so I've just used it for my purpose (here it is https://github.com/marcelbirkner/docker-ci-tool-stack ) First I've tried to understand building app example from that repo, but stuck in Groove DSL scripts. 如何尝试解决:我已经找到了docker-ci-tool-stack(“支持Devops的”平台:Jenkins,SonarQube,Nexus,GitLab),所以我只是将它用于我的目的(这里是https http://github.com/marcelbirkner/docker-ci-tool-stack )首先,我试图从该存储库中了解构建应用程序示例,但陷入了Groove DSL脚本中。 After I've been trying look some tutorials, documents on integration: Jenkins , Maven and Nexus, but it's incomprehensible for me. 在尝试了一些教程之后,我找到了一些有关集成的文档:Jenkins,Maven和Nexus,但是对我来说却是不可理解的。 I agree, that I should own each tool separately and after combine it together (and work in other place probably) , but I've a terms from by boss... What should I do? 我同意,我应该分别拥有每个工具,然后将它们组合在一起(可能在其他地方工作),但是我有老板的话……我该怎么办? I passed some courses in Linux Academy for Git, Docker and Jenkins, but I still feel really raw in practice that DevOps (CI/CD), Thank you. 我在Linux Academy上通过了一些有关Git,Docker和Jenkins的课程,但是在实践中,我仍然对DevOps(CI / CD)感到很头疼,谢谢。

You can do this by adding the distributionManagement section to your pom.xml file. 您可以通过将distributionManagement部分添加到pom.xml文件中来实现。

<project ...>

  ...

  <distributionManagement>
    <snapshotRepository>
      <id>nexus-snapshots</id>
      <url>http://your-host:8081/repository/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>nexus-releases</id>
      <url>http://your-host:8081/repository/maven-releases/</url>
    </repository>
  </distributionManagement>
</project>

And add in Jenkins job to Maven(mvn) section: 并将Jenkins工作添加到Maven(mvn)部分:

deploy

Briefly: 简要地:

More details here: 此处有更多详细信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM