Question

I've been going nuts over this for a good few hours and I cannot find any resources regarding how to specify the patterns for the published jars (these are being published to my local repository.

I have a file called peacock-lib-1.0.jar in a build directory created by another ant task. When running the publish ant task ivy finds the file and copies it into the local directory where I expect to find it. However, the destination file ends up being renamed peacock-lib.jar.

It's obviously just missing bit of configuration but I just can't find out what.

This is my ivy.xml:

<ivy-module version="2.0">
  <info organisation="myorg" module="peacock-lib" />

  <publications>
    <artifact name="peacock-lib" type="jar"/>
  </publications>

  <dependencies>
...
  </dependencies>

</ivy-module>

and my ant task:

  <target name="publish-local" description="--> Publish Local">
    <property name="ivy.organisation" value="myorg" />
    <property name="ivy.module" value="peacock-lib" />
    <property name="ivy.revision" value="${peacockLibVer}" />
    <ivy:publish resolver="local" pubrevision="${peacockLibVer}" status="release" update="true" overwrite="true">
      <artifacts pattern="dist/lib/[module]-[revision].[ext]" />
    </ivy:publish>
  </target>

any help will be greatly appreciated.

regards

fern

Was it helpful?

Solution

Thanks to Ian above for providing me with a pointer as to what the additional configuration was.

To resolve this I had a look at ivysettings.xml in the jar. In ivysettings-local.xml i saw what was causing the nomenclature I wanted to override so I generated my own ivysettings.xml affecting those values only (note that I didn't replace the original ivysettings.xml):

<ivysettings>
  <include url="${ivy.default.settings.dir}/ivysettings.xml"/>
  <property name="ivy.local.default.ivy.pattern"      value="[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]" override="true"/>
  <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]" override="true"/>
  <resolvers>
    <filesystem name="local">
      <ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
      <artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
    </filesystem>
  </resolvers>
</ivysettings>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top