You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by kamaci <fu...@gmail.com> on 2013/02/15 02:08:14 UTC

Custom Maven Plugin Development Archiving Files

I am developing my own custom Maven plugin and I want to archive the files. I
followd that example:
http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-mojo-params.html
and could archive the elements with zip format. However I want to use other
formats too(user will indicate it) how can I set archive type?

ZipArchiver works like that:

    /**
    * The Zip archiver.
    * @parameter \
    expression="${component.org.codehaus.plexus.archiver.Archiver#zip}"
    */
    private ZipArchiver zipArchiver;
    ...
    zipArchiver.addDirectory( buildDirectory, includes, excludes );
    zipArchiver.setDestFile( new File( baseDirectory, "output.zip" ) );
    zipArchiver.createArchive();



--
View this message in context: http://maven.40175.n5.nabble.com/Custom-Maven-Plugin-Development-Archiving-Files-tp5747036.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Custom Maven Plugin Development Archiving Files

Posted by Wayne Fay <wa...@gmail.com>.
> I am developing my own custom Maven plugin and I want to archive the files. I
> followd that example:
> http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-mojo-params.html
> and could archive the elements with zip format. However I want to use other
> formats too(user will indicate it) how can I set archive type?

Before you spend any (more) time working on a problem that has been
solved, look at the assembly plugin and make sure you cannot be made
happy using it, perhaps in some combination with your custom plugin
that would run in an earlier lifecycle phase, with the assembly plugin
responsible for the ultimate output at the end.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Custom Maven Plugin Development Archiving Files

Posted by Barrie Treloar <ba...@gmail.com>.
On 15 February 2013 11:38, kamaci <fu...@gmail.com> wrote:
> I am developing my own custom Maven plugin and I want to archive the files. I
> followd that example:
> http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-mojo-params.html
> and could archive the elements with zip format. However I want to use other
> formats too(user will indicate it) how can I set archive type?

You could look at the Maven Assembly Plugin
(http://maven.apache.org/plugins/maven-assembly-plugin/) which
supports creating archives of different types and see how it does it.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org