0

We have the build system, which builds a lot of components. Built components publish their artifacts by ivy in artifactory.

I want to attach an extra meta-artifact to each component during its publication, but transparently for developers. This meta-artifact will contain the information about build-agent, build-log, changelog, etc. I have access to build agents, so I can:

  • change some ivy configuration files on build agents
  • install a customized ivy with a patch on build agents
  • modify the ivysettings.xml file

I didn’t find any information in ivy documentation. However, I know that there are methods like “options.getExtraArtifacts()” in the ivy source code, so I guess there is a way.

Waiting for your suggestions.

Thanks in advance!

UPD: I figured out “options.getExtraArtifacts()” serve an "artifact" subtag in a "publish" tag: https://ant.apache.org/ivy/history/2.4.0/use/publish.html

dima125
  • 19
  • 4

1 Answers1

0

Option1 : Artifactory Metadata

Are you using Artifactory Pro? I'm not a user myself but the documentation describes a capability to attach arbitrary XML based metadata to any artifact stored in Artifactory. Standalone REST API that should be simple to call from your build:

https://www.jfrog.com/confluence/display/RTF2X/Attaching+and+Reading+Metadata

The big advantage of this approach is that this data is searchable

Option 2: Jenkins plugin

Again I'm not an Artifactory user, but have always been intrigued by this plugin that reportedly delivers tight integration between Jenkins and Artifactory. The relevent bit is the so called "Build info" that is published by the plugin. I would be surprised if this doesn't include some of the info your looking for.

https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+Plugin

Option 3: Attach a custom metadata file

A typical Maven repository has no support for metadata. Both Artifactory and Nexus have bespoke extensions and it appears that in both products this capability is a paid feature...

If all you want to do is store metadata and don't care about the lack of a search interface, then why not simply attach a file containing your metadata as an additional Module file? The following example documents how to do this:

how to publish 3rdparty artifacts with ivy and nexus

Option 4: Ivy extra attributes

This is only an option if you're storing data in an ivy repository (You are more likely using a Maven repo format).

Ivy has the ability to store custom attributes in the ivy module file.

http://ant.apache.org/ivy/history/latest-milestone/concept.html#extra

The following answer describes how these can also be used to influence the layout of your ivy repository.

Dynamically updating Ivy extra attributes

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185