如何将已解析的ivy.xml发布到Nexus

时间:2017-09-08 11:31:37

标签: ant nexus ivy

我的工件是一个文本文件,其中包含一些文本(提交ID)。这是我的ivy.xml和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创建文件并将其复制到我的存储库(Nexus)。这不会复制&#34;已解决&#34;的ivy.xml。我该如何发表呢?

1 个答案:

答案 0 :(得分:0)

更改

publishivy="false" 

 publishivy="true " 

解决了这一部分。