Use Ivy to manage directories instead of jar files?

Can Ivy or some other dependency management tool be used if your dependencies are directories instead of files?

I am building a PHP website, so my shared "libraries" are not jar files or any other archive. I know phph files in PHP 5.3, but I would prefer them to be directories, so the webserver can serve their content directly.

+2


source to share


1 answer


You can't depend on a directory, but you can zip your dependencies and then ask Ivy to unzip them on download. This means that when your application is created, they will be available locally on the web server.

packager provides an additional dest attribute that can be specified to unpack the archive into a subfolder. The following configuration should unpack the dependency to sub/dir

:



<property name="zipname" value="${name}-${version}"/>

<resource dest="sub/dir" url="http://testng.org/${zipname}.zip" 
  sha1="2ea19275dc17453306f8bb780fe6ef6e9af7756b">
    <url href="http://mirror.example.com/archives/${zipname}.zip"/>
    <include name="${zipname}/src/main/**/*"/>
    <include name="${zipname}/src/jdk15/**/*"/>
    <include name="${zipname}/javadocs/**/*"/>
    <include name="${zipname}/*.jar"/>
</resource>

      

+2


source







All Articles