Skip to content

An Apache Maven plugin designed for exporting an entire Maven project into a .zip file

License

Notifications You must be signed in to change notification settings

atp-mipt/export-maven-plugin

Repository files navigation

Export Maven Plugin

Actions Status: build Maven Central

The Export Maven Plugin is an Apache Maven plugin designed for exporting an entire Maven project into a .zip file. It respects the .gitignore settings and, regardless of .gitignore, always omits the build directory (target).

Why is it needed?

Typically, archiving a project involves the following command:

git archive -o export.zip HEAD

However, in teaching environments, particularly when instructing large groups in Java, it's not always feasible to assume that Git is installed on all systems. In scenarios where Git is not part of the course curriculum, and lab/homework submissions are required in .zip format, it's important to ensure that students' submissions do not include unwanted files, such as those in the build folder or IDE-specific directories.

Since students are expected to use Maven and create their projects via homework-quickstart archetype, this simple plugin enables students to automatically export their projects in the required format without including unwanted files.

How to use

To use the plugin, insert the following configuration into the plugins section of your pom.xml:

    <plugin>
        <groupId>org.atp-fivt</groupId>
        <artifactId>export-maven-plugin</artifactId>
        <version>1.0</version>
        <configuration>
            <zipFileName>Name_Surname.zip</zipFileName>
        </configuration>
    </plugin>

The zipFileName parameter allows you to specify the desired name for the zip file. By default, the file name is set to export.zip.

To run the plugin, execute:

mvn export:export

The resulting .zip file will be located in the target directory.

How does it work

This plugin leverages the jGit library to compile a list of all files in the project, adhering to the rules specified in .gitignore files. Importantly, the functionality of this plugin does not require Git to be installed on the target machine. This is particularly beneficial in educational settings or environments where Git installation cannot be assumed. By using jGit, the plugin operates independently of the local Git installation.

About

An Apache Maven plugin designed for exporting an entire Maven project into a .zip file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages