Jayan
Jayan

Reputation: 18459

How to publish resolved ivy.xml to Nexus

My artifact is a text file with some text in it(commit id). Here is my ivy.xml and build.xml

ivy.xml

<ivy-module version="2.0">  
<info organisation="org.myorg" 
      module="commit-info" 
      status="release"/>  
 <publications>  
     <artifact name="commit_info" type="text" ext="txt"/>  
 </publications>  
</ivy-module>  

build.xml

<project xmlns:ivy="antlib:org.apache.ivy.ant" name="SuperRoot" default="prepare" basedir=".">
<property file="../release.properties"/>

<path id="ivy.lib.path">
    <fileset dir="../lib" includes="*.jar"/>
</path>

<taskdef resource="org/apache/ivy/ant/antlib.xml"
         uri="antlib:org.apache.ivy.ant" 
         classpathref="ivy.lib.path"/>


<property name="organisation" value="org.myorg"/>
<property name="build.dir" value="."/>
<property name="ivy.dir" value="build/ivy"/>



<target name="init">
    <mkdir dir="build"/>
    <mkdir dir="build/ivy"/>
</target>


<target name="prepare" description="Generate POM">
    <ivy:settings file="../ivysettings.xml" />
    <ivy:retrieve />
    <!-- Optional: Intermediate file containing resolved version numbers -->
    <echo message="Using repo at ${repo.host} "/>
    <ivy:deliver deliverpattern="${ivy.dir}/ivy.xml" 
            pubrevision="${publish.revision}" 
            status="release"/>

    <!-- Generate the Maven POM -->
    <ivy:makepom ivyfile="${ivy.dir}/ivy.xml" 
             pomfile="${build.dir}/pom.xml"/>
</target>

<target name="publish" depends="init,prepare" description="Upload to Nexus">
    <ivy:resolve/>
    <ivy:publish organisation="org.myorg"  module="commit-info" 
               resolver="nexus-deploy" 
               pubrevision="${publish.revision}" 
               overwrite="true" 
               publishivy="false" >
               <artifacts pattern="${build.dir}/[artifact].[ext]"/>

    </ivy:publish>
  </target>
</project>

ant publish creates and copy the files to my repository (Nexus). This does not copy "resolved" ivy.xml. How can I publish it?

Upvotes: 1

Views: 767

Answers (1)

Jayan
Jayan

Reputation: 18459

Changing

publishivy="false" 

to

 publishivy="true " 

solved that part.

Upvotes: 1

Related Questions