我有一个ivy.xml - https://gist.github.com/1898060 我也有与这个ivy.xml相关的jar文件.我需要的是一个机制,将这个项目导入我的maven仓库并在我的maven项目中使用它.所以基本上如果我能够将ivy.xml转换为pom.xml,我可能能够让它工作.是否有一些机制可以实现这一目标.我正在寻找像maven插件这样的东西来完成这项任务.我知道有一些方法可以编辑ivy.xml和build.xml来实现这一点,但后来我不想这样做,因为该项目是在一个私人仓库中.
Mar*_*nor 17
您真正需要做的是将ANT项目构建的jar发布到Maven存储库中.
ant -Dproject.version=0.9.0-local-20120211095554 clean publish
Run Code Online (Sandbox Code Playgroud)
我知道您不想更改ANT版本,但创建额外的"发布"目标将正确集成您的ANT和Maven项目.
由修改后的ANT构建发布的两个jar工件可以正常使用,如下所示:
<dependency>
<groupId>com.opengamma</groupId>
<artifactId>og-analytics</artifactId>
<version>0.9.0-local-20120211095554</version>
</dependency>
<dependency>
<groupId>com.opengamma</groupId>
<artifactId>og-analytics</artifactId>
<version>0.9.0-local-20120211095554</version>
<classifier>sources</classifier>
</dependency>
Run Code Online (Sandbox Code Playgroud)
主要变化是您的出版物部分:
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
<info organisation="com.opengamma" module="og-analytics"/>
<publications>
<artifact name="og-analytics" type="jar"/>
<artifact name="og-analytics" type="pom"/>
<artifact name="og-analytics" type="jar" e:classifier="sources"/>
</publications>
<dependencies>
<dependency name="og-util" rev="0.9.0-local-20120211095525" revConstraint="latest.integration"/>
<dependency org="org.jfree" name="jfreechart" rev="1.0.13"/>
<dependency org="cern" name="colt" rev="1.2.0"/>
<dependency org="cern" name="parallelcolt" rev="0.9.1"/>
<dependency org="latexlet" name="latexlet" rev="1.11"/>
<dependency org="org.apache.commons" name="commons-math" rev="2.1"/>
<dependency org="it.dexy" name="json-doclet" rev="0.3.1"/>
<dependency org="org.json" name="simple" rev="1.1"/>
<exclude org="org.junit"/>
</dependencies>
</ivy-module>
Run Code Online (Sandbox Code Playgroud)
笔记:
<target name="prepare" description="Generate POM">
<fail message="Unset property: project.version" unless="project.version"/>
<ivy:deliver deliverpattern="${build.dir}/ivy.xml" pubrevision="${project.version}" status="release"/>
<ivy:makepom ivyfile="${build.dir}/ivy.xml" pomfile="${build.dir}/${ivy.module}.pom"/>
</target>
<target name="publish" depends="build,prepare" description="Upload to Nexus">
<ivy:publish resolver="nexus-deploy" pubrevision="${project.version}" overwrite="true" publishivy="false" >
<artifacts pattern="${build.dir}/[artifact](-[classifier]).[ext]"/>
</ivy:publish>
</target>
Run Code Online (Sandbox Code Playgroud)
笔记:
您可以在此配置发布构建目标使用的存储库和凭据的位置.
<ivysettings>
<settings defaultResolver="nexus-central"/>
<credentials host="somehost" realm="Sonatype Nexus Repository Manager" username="????" passwd="????"/>
<resolvers>
<ibiblio name="nexus-central" root="http://somehost/nexus/content/repositories/central/" m2compatible="true"/>
<ibiblio name="nexus-deploy" root="http://somehost/nexus/content/repositories/repo" m2compatible="true"/>
</resolvers>
</ivysettings>
Run Code Online (Sandbox Code Playgroud)
笔记:
归档时间: |
|
查看次数: |
12517 次 |
最近记录: |