ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bman <bp...@netspend.com>
Subject Re: Ivy Publishing Wrong Name to Artifactory
Date Mon, 12 Oct 2009 21:59:58 GMT

For now, I am using an ant workaround.  In build.xml, I define a property
that contains my list of deploy jar names.  Then I use antcontribs foreach
to iterate through them, create a ivy.xml, and publish each jar.  The
ivy.xml is created from a template file containing 2 tokens that are
replaced during a file copy.

In my build.xml:
  <property name="ivy.mod.list"
            value="jarone,jartwo,jarthree,jarfour" />

  <target name="ivy-publish" description="publishes artifact to ivy
repository">
    <foreach list="${ivy.mod.list}"
        delimiter=","
        target="foreach-ivy-publish"
        param="mod" />
  </target>

  <target name="foreach-ivy-publish">
	<copy file="ivy.xml.template" tofile="ivy.xml" filtering="true"
overwrite="true">
		<filterset>
			<filter token="mod" value="${mod}"/>
			<filter token="rev" value="${app.version}"/>
		</filterset>
	</copy>
  	<ivy:resolve/>
	<ivy:publish
artifactspattern="${basedir}/build/lib/${mod}-[revision].[ext]" 
		resolver="myPublisher" status="${ivy.status}" overwrite="true"
update="true"/>
  </target>

ivy.xml:
<ivy-module version="2.0">
    <info organisation="com.package" module="@mod@" revision="@rev@"/>

    <publications>
        <artifact name="@mod@" type="jar" ext="jar"/>
    </publications>

    </dependencies>
           ...
    </dependencies>
</ivy-module>


Daniel Becheanu wrote:
> 
> According with your log, ivy is publishing  with
> ns-jmx-1.2.0-SNAPSHOT.jar. ant not
> spyglass-1.2.0-SNAPSHOT. You might have spyglass-1.2.0-SNAPSHOT from a
> previous publish when you had a different publishing pattern.
> 
> Daniel
> 
> : publishing :: com.ns#spyglass
>        published ns-jmx to
> http://172.0.0.0:8080/artifactory-2.0.6/libs-snapshots-local/com.ns/spyglass/1.2.0-SNAPSHOT/ns-jmx-1.2.0-SNAPSHOT.jar
>        published ivy to
> http://172.0.0.0:8080/artifactory-2.0.6/libs-snapshots-local/com.ns/spyglass/1.2.0-SNAPSHOT/ivy-1.2.0-SNAPSHOT.xml
> 
> 
> On Mon, Aug 10, 2009 at 10:58 AM, bman<bpape@netspend.com> wrote:
>>
>> I tried this setup with nexus and it seems to work fine, so I'm guessing
>> it
>> must be an artifactory issue.
>>
>>
>>
>> Anil Gangolli wrote:
>>>
>>> The module name in your info element is "spyglass".  The path you have
>>> specified is
>>>
>>> [organisation]/[module]/[revision]/[artifact]-[revision].[ext]
>>>
>>>
>>> This looks correct.
>>>
>>> bman wrote:
>>>> Hi All,
>>>>
>>>> I'm using ant + ivy to push and pull from a local enterprise server
>>>> running
>>>> Artifactory.  For the most part it works great.  However, I have come
>>>> across
>>>> a situation where the jar name that I expect to be published to
>>>> Artifactory
>>>> is not being published with that name.  My local jar is named
>>>> ns-jmx-1.2.0-SNAPSHOT, but the published jar is named
>>>> spyglass-1.2.0-SNAPSHOT.  Any ideas why this is occurring?
>>>>
>>>> build.xml:
>>>>                      <ivy:publish
>>>> artifactspattern="${basedir}/dist/[artifact]-[revision].[ext]"
>>>>                      resolver="Publisher" status="integration"
>>>> overwrite="true"
>>>> update="true"/>
>>>>
>>>> ivysettings.xml:
>>>>              <url name="Publisher">
>>>>                              <artifact
>>>> pattern="http://172.0.0.0:8080/artifactory-2.0.6/libs-snapshots-local/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
>>>>                      </url>
>>>>
>>>> ivy.xml:
>>>>     <info organisation="com.ns" module="spyglass"
>>>> revision="1.2.0-SNAPSHOT"/>
>>>>
>>>>     <publications>
>>>>         <artifact name="ns-jmx" type="jar" ext="jar"/>
>>>>     </publications>
>>>>
>>>> build results:
>>>> :: delivering :: com.ns#spyglass;1.2.0-SNAPSHOT :: 1.2.0-SNAPSHOT ::
>>>> integration :: Thu Aug 06 15:44:27 CDT 2009
>>>>         delivering ivy file to
>>>> c:\dev\eclipse\workspace\spyglass\dist\ivy-1.2.0-SNAPSHOT.xml
>>>> :: publishing :: com.ns#spyglass
>>>>         published ns-jmx to
>>>> http://172.0.0.0:8080/artifactory-2.0.6/libs-snapshots-local/com.ns/spyglass/1.2.0-SNAPSHOT/ns-jmx-1.2.0-SNAPSHOT.jar
>>>>         published ivy to
>>>> http://172.0.0.0:8080/artifactory-2.0.6/libs-snapshots-local/com.ns/spyglass/1.2.0-SNAPSHOT/ivy-1.2.0-SNAPSHOT.xml
>>>>
>>>> BUILD SUCCESSFUL
>>>> Total time: 7 seconds
>>>>
>>>>
>>>> Thanks in advance for the help!
>>>> Barry
>>>>
>>>
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Ivy-Publishing-Wrong-Name-to-Artifactory-tp24854655p24902406.html
>> Sent from the ivy-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Ivy-Publishing-Wrong-Name-to-Artifactory-tp24854655p25863005.html
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message