简体   繁体   English

Artifactory不导入所有工件

[英]Artifactory not importing all artifacts

I am in charge of installing an Artifactory instance in a large corporate environment where Internet access isn't an option. 我负责在无法访问Internet的大型企业环境中安装Artifactory实例。 All Maven builds must fetch dependencies from an internal (intranet) Maven repository. 所有Maven构建都必须从内部(Intranet)Maven存储库获取依赖项。 A mirror was added to the settings.xml file, and is set to be the default mirror for everything. 镜像已添加到settings.xml文件中,并设置为所有内容的默认镜像。

I have then setup a standalone computer wired to the Internet to download all necessary dependencies (spring, struts2, etc.) that are endorsed to be used in the different projects across the organization. 然后,我设置了一台连接到Internet的独立计算机,以下载所有必要的依赖项(spring,struts2等),这些依赖项被认可用于整个组织的不同项目。 I created a dummy maven project using mvn archetype:generate in order to populate my local repository with all necessary stuffs for Maven to work as expected. 我使用mvn archetype:generate创建了一个虚拟maven项目,以便为我的本地存储库填充所有必要的东西,以便Maven按预期工作。

Installing Artifactory went well, and so was the import of specific dependencies like Spring and Struts2. 安装Artifactory进展顺利,导入Spring和Struts2等特定依赖项也是如此。 However, running mvn archetype:generate returned some errors like this: 但是,运行mvn archetype:generate会返回一些错误,如下所示:

The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.4 is missing, no dependency information available.

Thus, I realized I needed to import Maven plugins to the Artifactory instance as well, which I did. 因此,我意识到我需要将Maven插件导入Artifactory实例,我做了。 In fact, I have zipped the entire C:\\Users\\MYUSER.m2\\repository folder on the standalone computer, carried the zip over to the Artifactory server, and then used the Artifactory admin account to import everything using Admin > Import & Export > Repositories > Import Repository from Zip. 事实上,我已经在独立计算机上压缩了整个C:\\ Users \\ MYUSER.m2 \\ repository文件夹,将zip文件传送到Artifactory服务器,然后使用Artifactory管理员帐户使用管理>导入和导出>导入所有内容存储库>从Zip导入存储库。

Artifactory says that the import completed successfully, but I still get the same error complaining that some Maven plugins are missing. Artifactory说导入成功完成,但我仍然得到同样的错误抱怨一些Maven插件丢失。 Looking at the artifact page in Artifactory, I see that it's missing some Maven plugins artifacts that were part of the zip . 看看Artifactory中的工件页面,我发现它缺少一些作为zip部分的 Maven插件工件。 Artifactory did not import everything from my zip file. Artifactory没有导入我的zip文件中的所有内容。

org/apache/maven/plugins 组织/阿帕奇/行家/插件

  • maven-antrun-plugin Maven的antrun-插件
  • maven-archetype-plugin Maven的原型 - 插件
  • maven-assembly-plugin 行家组装-插件
  • maven-clean-plugin Maven的清理插件
  • maven-compiler-plugin Maven的编译器插件
  • maven-dependency-plugin Maven的依赖关系的插件
  • maven-deploy-plugin 行家 - 部署 - 插件
  • maven-install-plugin Maven的安装,插件
  • maven-plugins Maven的插件
  • maven-release-plugin 行家释放小插件
  • maven-resources-plugin Maven的资源 - 插件
  • maven-site-plugin Maven的网站插件
  • maven-surefire-plugin Maven的万无一失,插件
  • maven-war-plugin Maven的战争插件

Imported in Artifactory under org/apache/maven/plugins 在org / apache / maven / plugins下的Artifactory中导入

  • maven-clean-plugin Maven的清理插件
  • maven-compiler-plugin Maven的编译器插件
  • maven-plugins Maven的插件
  • maven-resources-plugin Maven的资源 - 插件
  • maven-surefire-plugin Maven的万无一失,插件
  • maven-war-plugin Maven的战争插件

So my question is, why is Artifactory silently omitting to import some dependencies without letting me know about it? 所以我的问题是,为什么Artifactory默默地省略了导入一些依赖关系而不让我知道它?

Thank you 谢谢

UPDATE UPDATE

Even when I browse for the Maven plugins from the standalone computer under org/apache/maven/plugins (Admin > Import & Export > Repositories > Import Repository from Path), Artifactory won't even show them to me. 即使我在org / apache / maven / plugins(Admin> Import&Export> Repositories> Import Repository from Path)下从独立计算机浏览Maven插件,Artifactory也不会向我显示。 It will only display the ones that I have listed above. 它只会显示我上面列出的那些。

UPDATE 2017-08-23 更新2017-08-23

artifactory.log artifactory.log

2017-08-23 08:18:13,100 [art-exec-1] [INFO ] (o.a.r.d.i.DbRepoImportHandler:149) - repo-endorsed import started C:\dev\repository
    2017-08-23 08:18:40,468 [art-exec-1] [INFO ] (o.a.r.d.i.ImportExportAccumulator:98) - repo-endorsed imported 1000 items (574 files 426 folders 36.58 ips) 0 skipped items (0 files 0 folders)...
    2017-08-23 08:19:06,906 [art-exec-1] [INFO ] (o.a.r.d.i.ImportExportAccumulator:98) - repo-endorsed imported 2000 items (1129 files 871 folders 37.18 ips) 0 skipped items (0 files 0 folders)...
    2017-08-23 08:19:15,829 [art-exec-1] [INFO ] (o.a.r.d.i.DbRepoImportHandler:199) - repo-endorsed import finished with: 2264 Items imported: (1262 files 1002 folders). Duration: 1.04 minutes IPS: 36.14 Target: 'C:\dev\repository'
    2017-08-23 08:19:15,829 [art-exec-3] [INFO ] (o.a.r.s.ImportJob   :127) - Import of 1 repositories completed

import.export.log import.export.log

I see several messages like this one, but the artifact is getting imported as expected: 我看到像这样的几条消息,但工件按预期导入:

2017-08-23 08:18:36,655 [DEBUG] (o.a.a.c.ImportExportStatusHolder:43) No Metadata entries found for C:\dev\repository\org\apache\maven\plugins\maven-compiler-plugin\3.1\maven-compiler-plugin-3.1.jar

Looking at those messages, I don't see anything related to missing parts like maven-install-plugin. 看看这些消息,我没有看到任何与maven-install-plugin等缺失部分相关的内容。 Looks like Artifactory literally skipped it. 貌似Artifactory字面意思是跳过了它。

Thanks for adding the additional information. 感谢您添加其他信息。 Just to make sure, when you are going to: 只是为了确保,当你要去:

C:\dev\repository\org\apache\maven\plugins\maven-compiler-plugin\3.1

can you see the maven-compiler-plugin-3.1.pom file? 你能看到maven-compiler-plugin-3.1.pom文件吗?

If Artifactory doesn't have the pom file it will not generate the maven-metadata file on the folder level, meaning that the maven client won't get it as a result when you run a maven build. 如果Artifactory没有pom文件,它将不会在文件夹级别生成maven-metadata文件,这意味着当您运行maven构建时,maven客户端将无法获得它。

To overcome this issue, if this is indeed a missing POM, you can manually deploy this JAR file to that location via the UI and use the "auto generate POM" feature which will create a POM file to that JAR, resulting with maven-metadata calculation. 要解决此问题,如果这确实是一个缺失的POM,您可以通过UI手动将此JAR文件部署到该位置,并使用“自动生成POM”功能,该功能将为该JAR创建一个POM文件,从而生成maven-metadata计算。

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

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