Using Repositories


The Assembly Plugin allows the inclusion of needed artifacts from your local repository to the generated archive. They are copied into the assembly in a directory similar to what's in your remote repository, complete with metadata and the checksums.

This example demonstrates the creation of repository artifacts in an assembly so that the archive can easily be used to update an internal repository with the artifacts used by your project.

The Assembly Descriptor

A functional repository archive for your project can be created with:

<assembly xmlns=""

The above descriptor tells the Assembly Plugin to create a repository-like directory structure inside the maven2 directory from within the generated archive. Setting includeMetadata to true will make the plugin to also copy metadata information into the generated archive.


The pom.xml for your project is very similar to how you configure the Assembly Plugin for other distribution types.


Generating The Assembly Archive

The assembly archive is then created using:

mvn clean assembly:single

The generated archive can be extracted to an internal repository so users of your project can download the dependencies from it.

Examining the Output

When the Maven execution completes, the archive contents should be similar to:

`-- maven2
    |-- groupId
    |   |-- maven-metadata.xml
    |   |-- maven-metadata.xml.md5
    |   |-- maven-metadata.xml.sha1
    |   `-- artifactId
    |       |-- maven-metadata.xml
    |       |-- maven-metadata.xml.md5
    |       |-- maven-metadata.xml.sha1
    |       `-- version
    |           |-- artifactId-version.jar
    |           |-- artifactId-version.jar.md5
    |           |-- artifactId-version.jar.sha1
    |           |-- artifactId-version.pom
    |           |-- artifactId-version.pom.md5
    |           |-- artifactId-version.pom.sha1
    |           |-- maven-metadata.xml
    |           |-- maven-metadata.xml.md5
    |           `-- maven-metadata.xml.sha1
    `-- groupId2
        `-- [...]