0

With maven, is it possible to create a zip file of my maven project? The zip file should also contain the pom.xml file and all others. The zip file is the archive of the maven project. Basically, I just want my user to easily import the project into Eclipse after unpacking the zip file.

How do I achieve this with maven?

Thanks!

His
  • 5,891
  • 15
  • 61
  • 82
  • 1
    check this http://stackoverflow.com/questions/7837778/maven-best-practice-for-creating-ad-hoc-zip-artifact – NPKR Jan 30 '13 at 05:40
  • and this https://stackoverflow.com/questions/25078028/how-to-create-zip-target-instead-of-jar-in-maven – Adam Jul 25 '17 at 16:19

2 Answers2

4

You can accomplish this using maven-assembly-plugin that Pradeep suggested.

And also using maven-antrun-plugin. See the pom and zip task. Include the files that you want in fileset.

Govil
  • 2,034
  • 20
  • 20
1

You can use antrun plugin

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <target>
                    <zip destfile="d:/projectname.zip" basedir="${project.basedir}" excludes="target/**" />
                </target>
            </configuration>
        </plugin>

run it from Eclipse Run As -> Maven build... -> Goals: antrun:run

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275