My ivy.xml and publish target are slightly different. I also have a maven
classifier on my artifacts. First, in ivy.xml, I added xmlns:m="*
http://ant.apache.org/ivy/maven*" to the ivy-module definition.
My artifact definitions are such:
<artifact conf="*default*" name="*sers-client*" type="*jar*" ext="*jar*" />
<artifact conf="*default*" name="*sers-client*" type="*source*" ext="*jar*
" m:classifier="*sources*" />
<artifact conf="*default*" name="*sers-client*" type="*javadoc*" ext="*
jar*" m:classifier="*javadoc*" />
In ant, I separated the files by type into their own directory, so once
everything builds, but before the publish, the structure looks like:
dist
- jar
- sers-client.jar
- source
- sers-client.jar
- javadoc
- sers-client.jar
My publish target then looks like:
<ivy:publish pubrevision="*${ivyPubRevision}*" resolver="*${ivyPubResolver}*
" update="*true*" overwrite="*true*">
<artifacts pattern="*${dist}/[type]/[artifact].[ext]*" />
</ivy:publish>
When this publishes, I get sers-client-2.0.jar, sers-client-2.0-sources.jar
and sers-client-2.0-javadoc.jar in my repo.
There might be a better way, but I haven't found it.
Hope this helps.
Thanks,
topher
On Wed, Jan 27, 2010 at 3:28 PM, Claudio Miranda <[email protected]>wrote:
>
> Hi, I am having some troubles getting the source publication to work.
>
> The ivy.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.0">
> <info module="${ant.project.name}" organisation="com.company"
> revision="${version}"/>
> <configurations>
> <conf name="compile" extends="runtime"/>
> <conf name="runtime" transitive="false" />
> </configurations>
> <publications>
> <artifact name="${ant.project.name}" type="jar" ext="jar"/>
> <artifact name="${ant.project.name}-source" type="source"
> ext="jar"
> />
> </publications>
> <dependencies>
> <dependency org="com.company" name="report-commons" rev="1.0"
> conf="compile->default" />
> <dependency org="com.company" name="commons-framework" rev="0.1"
> conf="compile->default" />
> </dependencies>
> </ivy-module>
>
>
>
> The relevant build.xml related to publish
> <ivy:publish overwrite="true" resolver="local-ivy-cache">
> <artifacts pattern="${dist.dir}/[module]-[revision].[ext]" />
> <artifacts pattern="${dist.dir}/[module]-[revision]-source.[ext]" />
> </ivy:publish>
>
> The ant output
> publish:
> [jar] Building jar:
>
> c:\alphaworks_company\report-web\report-provider\dist\report-provider-1.6-source.jar
> [ivy:publish] :: loading settings :: file =
> c:\alphaworks_company\report-web\ivysettings.xml
> :: delivering :: com.company#report-provider;1.6 :: 1.6 :: integration ::
> Wed Jan 27 20:21:02 BRST 2010
> delivering ivy file to
>
> c:\alphaworks_company\report-web\report-provider\dist\report-provider-1.6.xml
> :: publishing :: com.company#report-provider
> published report-provider to
> c:/temp/ivy-cache/com.company/report-provider/jars/report-provider-1.6.jar
> published report-provider-source to
>
> c:/temp/ivy-cache/com.company/report-provider/sources/report-provider-source-1.6.jar
> published ivy to
> c:/temp/ivy-cache/com.company/report-provider/ivys/ivy-1.6.xml
>
>
> The
>
> c:/temp/ivy-cache/com.company/report-provider/sources/report-provider-source-1.6.jar
> is the same file as
> c:/temp/ivy-cache/com.company/report-provider/jars/report-provider-1.6.jar
>
> The generated jar files at report-provider\dist are (they are correct)
> report-provider-1.6-source.jar - size 6.003
> report-provider-1.6.jar - size 9.152
>
>
>
> So, how to publish the source jar file correctly ?
>
> Thanks
>
> Claudio
>
> -----
> Claudio Miranda
> http://weblogs.java.net/blog/claudio
> http://www.claudius.com.br/blog
> --
> View this message in context:
> http://old.nabble.com/Publish-the-source-jar---the-jar-file-is-the-binary-tp27347927p27347927.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>