2017-09-08 63 views
0

我的工件是一個文本文件,其中包含一些文本(commit id)。這是我的ivy.xml和build.xml文件如何將已解析的ivy.xml發佈到Nexus

的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> 

螞蟻發佈創建和複製文件到我的倉庫(的Nexus )。這不會複製「已解決」的ivy.xml。我如何發佈它?

回答

0

改變

publishivy="false" 

publishivy="true " 

解決了一部分。

相關問題