简体   繁体   English

如何在Maven项目中使用JFrog工件存储库

[英]How to use JFrog artifact repository in a Maven project

Please let me know how I could use/import/download a tool from JFrog artifact repository to my Maven project. 请让我知道如何从JFrog工件存储库使用/导入/下载工具到我的Maven项目。 I have not worked with artifactory before and Googling did not help much so any help on this would be much appreciated. 我以前没有使用过人工制品,因此Googling并没有太大帮助,因此在此方面的任何帮助将不胜感激。

您可能应该从Artifactory 用户指南中的“ 使用Maven”部分开始

If you want to work with a Jfrog Artifactory from your maven project you need to: 如果要从Maven项目中使用Jfrog Artifactory,则需要:

  • Create maven repos in Jfrog Artifactory. 在Jfrog Artifactory中创建Maven仓库。

    I recomend you to create a local SNAPSHOT repo and a local release repo for every type of maven repo that you want. 我建议您为每种所需的Maven存储库类型创建本地SNAPSHOT存储库和本地发行版本存储库。

    Example of local repos: 本地存储库示例:

     libsrepo-snapshot-local libsrepo-release-local projectsrepo-snapshot-local projectsrepo-local-local 

    You can create a remote repo for external dependencies, for example, for maven central. 您可以为外部依赖项(例如,Maven Central)创建远程仓库。

    Example of remote repo: 远程回购示例:

     maven-remote 

    Also, you can create a virtual repo to agrupe all your maven repo. 另外,您可以创建一个虚拟仓库来整合所有的Maven仓库。 For example, you can create the repo "maven-virtual-repo" where you can have all the repos that you want. 例如,您可以创建存储库“ maven-virtual-repo”,在其中可以拥有所需的所有存储库。

    Example of virtual repo: 虚拟仓库示例:

     maven-virtual-repo 
  • Configure your settings.xml to work with your Jfrog Artifactory repos. 配置settings.xml以与Jfrog Artifactory仓库一起使用。 You can get more info here: How to configure your settings.xml to work with repositories 您可以在此处获得更多信息: 如何配置settings.xml以使用存储库

  • Deploy to Jfrog Artifactory using: 使用以下方法部署到Jfrog Artifactory:

     mvn deploy 

If you need more help about how to create repos in Jfrog Artifactory you can visit the official guide: Configuring Repositories 如果您需要有关如何在Jfrog Artifactory中创建存储库的更多帮助,则可以访问官方指南: 配置存储库

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

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