苛刻刺耳的常春藤 [英] Harsh Jarring with ivy

查看:257
本文介绍了苛刻刺耳的常春藤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人碰巧知道是否有检索罐子库的内容转换成一个单一的罐子的方式 - 所以,这将是

Does someone happens to know if there is a way to retrieve the contents of jar libs into one single jar - so that it would be

jar 1 :
     org
       smth
         new.class

jar 2 :
     org
       smth
         also.class

jar 3 :
     org
       another
         otheralso.class

that single jar:
        org
          another
            one.class
          smth
            two class

result jar :
        org
          another
            one.class
            otheralso.class
        smth
           two class
           also.class
           new.class

常春藤和蚂蚁)我有一个cachepath或cachefileset)

with ivy and ant ) i have a cachepath or cachefileset )

推荐答案

需要常春藤与常规插件结合起来。

Need to combine ivy with the groovy plug-in.

<target name="resolve">
    <ivy:resolve/>
    <ivy:cachepath pathid="build.path" conf="build"/>
    <ivy:cachefileset setid="jarfiles" conf="jars"/>
</target>

<target name="combine-jars" depends="resolve">
    <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="build.path"/>

    <!-- 
    Iterate thru each file expanding content into a temp directory
    used to create a new jar
    -->
    <groovy>
    project.references.jarfiles.each {
        ant.unzip(src: it, dest:"build/tmp")
    }
    ant.jar(destfile:"build/newjar.jar", basedir:"build/tmp")
    </groovy>
</target>

的ivy.xml

使用常春藤配置,下载分成构建依赖关系和集合
文件到构建内稍后结合

ivy.xml

Use ivy configurations to separate downloads into build dependencies and a collection of files to be later combined within the build.

<ivy-module version="2.0">
    <info organisation="org.myspotontheweb" module="demo"/>
    <configurations>
        <conf name="build" description="ANT tasks"/>
        <conf name="jars"  description="Files to be combined"/>
    </configurations>
    <dependencies>
        <!-- build dependencies -->
        <dependency org="org.codehaus.groovy" name="groovy-all" rev="1.8.2" conf="build->default"/>

        <!-- jars dependencies -->
        <dependency org="log4j" name="log4j" rev="1.2.16" conf="jars->default"/>
        <dependency org="commons-lang" name="commons-lang" rev="2.6" conf="jars->default"/>
        ..
        ..
    </dependencies>
</ivy-module>

这篇关于苛刻刺耳的常春藤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆