Artifactory插件中的模件工件和依赖关系数据

时间:2023-01-20 22:44:26

I'm trying to replicate what the module and dependencies data as referenced here. Currently when we deploy an artifact to Artifactory from Jenkins none of the dependency and module information is supplied.

我正在尝试复制这里引用的模块和依赖项数据。目前,当我们从Jenkins向Artifactory部署工件时,不会提供依赖项和模块信息。

Our project has a defined pom.xml, but none of the information as demonstrated below is populating. How does Jenkins get this dependency information to send to Artifactory? We are using Artifactory Pro.

我们的项目有一个已定义的pom.xml,但下面演示的信息都没有填充。 Jenkins如何获取此依赖关系信息以发送给Artifactory?我们正在使用Artifactory Pro。

Artifactory插件中的模件工件和依赖关系数据

1 个解决方案

#1


2  

In order to have this information inside Artifactory you should use the Jenkins Artifactory plugin (the question tags suggests you are using Jenkins) in order to deploy your build results into Artifactory.
The integration is available for Gradle, Maven, Ivy and freestyle build jobs.
When using the plugin to deploy your build results to Artifactory, the plugin will send a BuildInfo data object to Artifactory (via REST) at the end of deployment. BuildInfo is a structured JSON object containing all the data about the build environment, artifacts and dependencies. This information is collected by the plugin during the build process and reflects what was actually used/done (this is not based on static analysis of your build). The information is collected using various types of build-info extractors (per build technology), for example, in the case of Maven jobs the information is collected from Maven by installing a Maven execution listener.
For freestyle jobs there is support for generic builds. If your freestyle job is executing a Maven build, you can alternatively use the Maven Artifactory Plugin in order to collect and deploy the build-info.

为了在Artifactory中包含此信息,您应该使用Jenkins Artifactory插件(问题标签建议您使用Jenkins),以便将构建结果部署到Artifactory中。该集成适用于Gradle,Maven,Ivy和freestyle构建作业。当使用插件将构建结果部署到Artifactory时,插件将在部署结束时将BuildInfo数据对象发送到Artifactory(通过REST)。 BuildInfo是一个结构化的JSON对象,包含有关构建环境,工件和依赖项的所有数据。插件在构建过程中收集此信息,并反映实际使用/完成的内容(这不是基于构建的静态分析)。使用各种类型的构建信息提取器(每种构建技术)收集信息,例如,在Maven作业的情况下,通过安装Maven执行监听器从Maven收集信息。对于*式作业,支持通用构建。如果您的*式作业正在执行Maven构建,您可以使用Maven Artifactory插件来收集和部署构建信息。

The JSON representation of the data looks something like this (but with much more info):

数据的JSON表示看起来像这样(但有更多信息):

{
  "version" : "1.0.1",
  "name" : "build-name",
  "number" : "100",
  "type" : "MAVEN",
  "buildAgent" : {
    "name" : "Maven",
    "version" : "3.0.5"
  },
  "agent" : {
    "name" : "Jenkins",
    "version" : "1.534"
  },
  "modules" : [ {
    "id" : "org.foo:bar:1.0.0-SNAPSHOT",
    "artifacts" : [ {
      "type" : "jar",
      "sha1" : "b790a0659bf001a64ee2ca88590e4bc6e0818f4b",
      "md5" : "0879ee3509f623c58a40a9db30df8090",
      "name" : "bar-1.0.0-SNAPSHOT.jar"
    },],
    "dependencies" : [ {
      "type" : "jar",
      "sha1" : "686ef3410bcf4ab8ce7fd0b899e832aaba5facf7",
      "md5" : "b45be74134796c89db7126083129532f",
      "id" : "commons-beanutils:commons-beanutils:1.8.3",
      "scopes" : [ "provided" ]
    }]
  }
}

When using the OSS version of Artifactory, Build Integration includes the Generic BuildInfo View and the ability to traverse and view build information using Artifactory's REST APIs. Module Artifacts and Dependencies View, Repository View of Builds and the ability to export and manipulate build items require the Pro version.

使用Artifactory的OSS版本时,Build Integration包括Generic BuildInfo View以及使用Artifactory的REST API遍历和查看构建信息的功能。模块工件和依赖关系视图,构建存储库视图以及导出和操作构建项目的能力需要Pro版本。

To use the Jenkins Artifactory plugin, follow the instructions provided here.

要使用Jenkins Artifactory插件,请按照此处提供的说明操作。

#1


2  

In order to have this information inside Artifactory you should use the Jenkins Artifactory plugin (the question tags suggests you are using Jenkins) in order to deploy your build results into Artifactory.
The integration is available for Gradle, Maven, Ivy and freestyle build jobs.
When using the plugin to deploy your build results to Artifactory, the plugin will send a BuildInfo data object to Artifactory (via REST) at the end of deployment. BuildInfo is a structured JSON object containing all the data about the build environment, artifacts and dependencies. This information is collected by the plugin during the build process and reflects what was actually used/done (this is not based on static analysis of your build). The information is collected using various types of build-info extractors (per build technology), for example, in the case of Maven jobs the information is collected from Maven by installing a Maven execution listener.
For freestyle jobs there is support for generic builds. If your freestyle job is executing a Maven build, you can alternatively use the Maven Artifactory Plugin in order to collect and deploy the build-info.

为了在Artifactory中包含此信息,您应该使用Jenkins Artifactory插件(问题标签建议您使用Jenkins),以便将构建结果部署到Artifactory中。该集成适用于Gradle,Maven,Ivy和freestyle构建作业。当使用插件将构建结果部署到Artifactory时,插件将在部署结束时将BuildInfo数据对象发送到Artifactory(通过REST)。 BuildInfo是一个结构化的JSON对象,包含有关构建环境,工件和依赖项的所有数据。插件在构建过程中收集此信息,并反映实际使用/完成的内容(这不是基于构建的静态分析)。使用各种类型的构建信息提取器(每种构建技术)收集信息,例如,在Maven作业的情况下,通过安装Maven执行监听器从Maven收集信息。对于*式作业,支持通用构建。如果您的*式作业正在执行Maven构建,您可以使用Maven Artifactory插件来收集和部署构建信息。

The JSON representation of the data looks something like this (but with much more info):

数据的JSON表示看起来像这样(但有更多信息):

{
  "version" : "1.0.1",
  "name" : "build-name",
  "number" : "100",
  "type" : "MAVEN",
  "buildAgent" : {
    "name" : "Maven",
    "version" : "3.0.5"
  },
  "agent" : {
    "name" : "Jenkins",
    "version" : "1.534"
  },
  "modules" : [ {
    "id" : "org.foo:bar:1.0.0-SNAPSHOT",
    "artifacts" : [ {
      "type" : "jar",
      "sha1" : "b790a0659bf001a64ee2ca88590e4bc6e0818f4b",
      "md5" : "0879ee3509f623c58a40a9db30df8090",
      "name" : "bar-1.0.0-SNAPSHOT.jar"
    },],
    "dependencies" : [ {
      "type" : "jar",
      "sha1" : "686ef3410bcf4ab8ce7fd0b899e832aaba5facf7",
      "md5" : "b45be74134796c89db7126083129532f",
      "id" : "commons-beanutils:commons-beanutils:1.8.3",
      "scopes" : [ "provided" ]
    }]
  }
}

When using the OSS version of Artifactory, Build Integration includes the Generic BuildInfo View and the ability to traverse and view build information using Artifactory's REST APIs. Module Artifacts and Dependencies View, Repository View of Builds and the ability to export and manipulate build items require the Pro version.

使用Artifactory的OSS版本时,Build Integration包括Generic BuildInfo View以及使用Artifactory的REST API遍历和查看构建信息的功能。模块工件和依赖关系视图,构建存储库视图以及导出和操作构建项目的能力需要Pro版本。

To use the Jenkins Artifactory plugin, follow the instructions provided here.

要使用Jenkins Artifactory插件,请按照此处提供的说明操作。