发布工件时出现问题(Ivy发布多个名称不同但内容相同的JAR)
我有一个奇怪的问题,在我的发布任务中,将一个ivy.xml中存在的多个工件发布到存储库中是非常好的,但是这些工件的内容是相同的。简言之,ivy发布多个工件,其名称与ivy.xml的publish标记中的名称不同,但每个工件中的内容相同。以下是我所做工作的历史: ppm-ivy.xml发布工件时出现问题(Ivy发布多个名称不同但内容相同的JAR),ivy,Ivy,我有一个奇怪的问题,在我的发布任务中,将一个ivy.xml中存在的多个工件发布到存储库中是非常好的,但是这些工件的内容是相同的。简言之,ivy发布多个工件,其名称与ivy.xml的publish标记中的名称不同,但每个工件中的内容相同。以下是我所做工作的历史: ppm-ivy.xml <ivy-module version="2.0"> <info organisation="ppm" module="ppm"/> <configurations>
<ivy-module version="2.0">
<info organisation="ppm" module="ppm"/>
<configurations>
<conf name="internal" description="found within JP repositories" />
</configurations>
<publications>
<artifact name="ppm" type="jar" ext="jar"/>
<artifact name="xbeancomponent" type="jar" ext="jar"/>
</publications>
<dependencies>
<dependency org="junit" name="junit" rev="latest.integration" conf="internal-> *"/>
<dependency org="qpid" name="qpid-client" rev="${qpidVersion}" conf="internal-> *"/>
<dependency org="guice" name="guice" rev="${guiceVersion}" conf="internal-> *"/>
</dependencies>
</ivy-module>
build.xml
<target name="publishPPM" description="publish merlin service to shared repo with ivy">
<ivy:resolve settingsRef="2" file="ppm-ivy.xml" revision="${ppmVersion}" type="jar" />
<ivy:publish settingsRef="2" resolver="publish" srcivypattern="ppm-ivy.xml" organisation="ppm" module="ppm" revision="${ppmVersion}" pubrevision="${ppmVersion}" forcedeliver="true" status="release" overwrite="true">
<artifacts pattern="${srcRoot}/tmp/jars/[module].[ext]" />
</ivy:publish>
</target>
应用程序创建的我的罐子ppm-${ppmversion}.jar
xbeancomponent-${ppmversion}.jar
在${srcRoot}/tmp/jars中 在解析器中,我使用的是谷歌提供的svnkit
..
..
..
....
.. 问题:
1.上述设置的问题是,当我运行publishPPM任务时,它会用我不想要的实际版本更改我的ppm-ivy.xml。如果它将该文件写入svn(它没有这样做),但不写入svn中提交的源代码中,那么就可以了。 所以我试着从ivy:publish任务中删除forcedeliver=“true”(我真的不知道这个任务做什么)属性,这很有帮助,但我得到了预期的verisoninternal@.. 而不是1.2.0 我在build.xml中的新任务是
<target name="publishPPM" description="publish merlin service to shared repo with ivy">
<ivy:resolve settingsRef="2" file="ppm-ivy.xml" revision="${ppmVersion}" type="jar" />
<ivy:publish settingsRef="2" resolver="publish" srcivypattern="ppm-ivy.xml" organisation="ppm" module="ppm" revision="${ppmVersion}" pubrevision="${ppmVersion}" status="release" overwrite="true">
<artifacts pattern="${srcRoot}/tmp/jars/[module].[ext]" />
</ivy:publish>
</target>
我解决这个问题的方法是在ppm-ivy.xml中的info标记中添加revision属性,因此我的ppm-ivy.xml如下所示:
<ivy-module version="2.0">
<info organisation="ppm" module="ppm" revision="${ppmVersion}"/>
<configurations>
<conf name="internal" description="found within JP repositories" />
</configurations>
<publications>
<artifact name="ppm" type="jar" ext="jar"/>
<artifact name="xbeancomponent" type="jar" ext="jar"/>
</publications>
<dependencies>
<dependency org="junit" name="junit" rev="latest.integration" conf="internal-> *"/>
<dependency org="qpid" name="qpid-client" rev="${qpidVersion}" conf="internal-> *"/>
<dependency org="guice" name="guice" rev="${guiceVersion}" conf="internal-> *"/>
</dependencies>
</ivy-module>
现在,它将这两个文件发布到存储库中,但问题是xbeancomponent.jar与ppm.jar完全相同,只是名称不同。你能帮帮我吗 我认为主要问题在于您用于查找要发布的工件的模式:
<artifacts pattern="${srcRoot}/tmp/jars/[module].[ext]" />
您没有包括工件名称,只有模块名称。您的模块名为“ppm”,因此每个jar工件都将基于此模式标识为ppm.jar。您可能希望改用此选项:
<artifacts pattern="${srcRoot}/tmp/jars/[artifact].[ext]" />
至于其他方面,关于svn和版本,恐怕我不理解这个问题。如果您仍然需要帮助,请澄清
<artifacts pattern="${srcRoot}/tmp/jars/[artifact].[ext]" />