With Maven2, how would I zip a directory in my resources?

Posted by Benny on Stack Overflow See other posts from Stack Overflow or by Benny
Published on 2010-05-07T13:37:30Z Indexed on 2010/05/07 13:48 UTC
Read the original article Hit count: 228

Filed under:
|

I'm trying to upgrade my project from using Maven 1 to Maven 2, but I'm having a problem with one of the goals. I have the following Maven 1 goal in my maven.xml file:

<goal name="jar:init">
    <ant:delete file="${basedir}/src/installpack.zip"/>
    <ant:zip destfile="${basedir}/src/installpack.zip"
             basedir="${basedir}/src/installpack" />

    <copy todir="${destination.location}">
        <fileset dir="${source.location}">
            <exclude name="installpack/**"/>
        </fileset>
    </copy>
</goal>

I'm unable to find a way to do this in Maven2, however.

Right now, the installpack directory is in the resources directory of my standard Maven2 directory structure, which works well since it just gets copied over. I need it to be zipped though.

I found this page on creating ant plugins: http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html.

It looks like I could create my own ant plugin to do what I need. I was just wondering if there was a way to do it using only Maven2.

Any suggestions would be much appreciated.

Thanks, B.J.

© Stack Overflow or respective owner

Related posts about ant

Related posts about maven-2