1

Can anybody give me a hint on how to use nested artifact (and artifacts) elements for publishing modules use the ivy ant task. Unfortunately the official documentation does not specify how to use the attributes. http://ant.apache.org/ivy/history/latest-milestone/use/publish.html

Maybe there is some documentation or some examples that I could not find? I am aware of the artifact element in ivy.xml files. this is NOT what this question is about.

jens
  • 1,763
  • 1
  • 15
  • 25
  • why do you need this? normally you define all the publicated artifacts in your ivy.xml – oers May 25 '12 at 11:13
  • I was looking for a way to have something like an optional artifact. Just before giving in and accepting that this is no valid ivy concept I stumbled upon this interesting looking newer feature of the publish task, unfortunately without sufficient documentation. – jens May 25 '12 at 11:23
  • I don't know for sure but I would assume that by artifact they mean [this](https://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency-artifact.html), everything described there could be used under publish – oers May 25 '12 at 11:27

1 Answers1

1

Does this answer to this question help?

Issues using ivy:publish task

The nested "artifact" elements in the publish task are used to identify the location(s) of the artifacts you've specified as to be published by your module.

So, for example, let's say your module publishes two files:

<ivy-module version="2.0">
    <info organisation="someorganisation" module="myapp"/>

    <publications>
        <artifact name="myapp" type="jar"/>
        <artifact name="license" type="txt"/>
    </publications>
    ..

Your publish task might need to source these files from two different locations within the build workspace:

   <ivy:publish resolver="${publish.resolver}" pubrevision="${publish.revision}" status="${publish.status}">
        <artifacts pattern="${build.dir}/[artifact].[ext]"/>
        <artifacts pattern="${src.dir}/licenses/[organisation]/[artifact].[ext]"/>
    </ivy:publish>
Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • This is the example for the `artifacts` element inside `publish`, but what about `artifact`? – Chin Jan 15 '20 at 18:28