Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: incorporate feedback from Brian and from John

...

The structure of the local repository should become:

Code Block
.
|-- cache
|   |-- snapshots
|   `-- releases
|-- remoterepositories
|   |-- apache.snapshots
|   |-- central
|   |-- codehaus.snapshots
|   `-- ...
`-- workspace
    |-- default
    |-- workspace1
    `-- ...

The purposes of these directories are as follows:

cache (snapshots, releases)

immutable artifacts downloaded from a remote repository. No metadata is stored in this directory tree. Snapshots are stored separately by default to make it easier to remove them periodically.

remote

contains a directory for each remote repository (by repository identifier). This contains the metadata and mutable artifacts from that repository. Metadata files will return to the format maven-metadata.xml instead of the current maven-metadata-<id>.xml file format. Files in these repositories will typically be snapshots and metadata for releases, since actual releases are not mutable and can be stored in the cache directory, however if you wish to store actual artifacts in this directory they will be used instead of the cache, allowing a simple way to rsync a remote repository and use it as a local repository (and vice-versa).

workspace

contains a directory for each local workspace, with the primary one being default. This contains the metadata and files for any artifact built by maven (both snapshots, and releases).

Under each of these locations, the standard layout remains as it is now:

Code Block
.
|-- cache
|   |-- snapshots
|   |   |-- com
|   |   |   `-- example
|   |   |       `-- ...
|   |   `-- org
|   |       |-- apache
|   |       |   `-- ...
|   |       `-- codehaus
|   |           `-- ...
|   `-- releases
|       `-- org
|           `-- apache
|               `-- ...
|-- remoterepositories
|   |-- apache.snapshots
|   |   `-- org
|   |       `-- apache
|   |           `-- ...
|   |-- central
|   |-- codehaus.snapshots
|   |   `-- org
|   |       `-- codehaus
|   |           `-- ...
|   `-- ...
`-- workspace
    |-- default
    |   `-- com
    |       `-- example
    |           `-- ...
    |-- workspace1
    `-- ...

...

A best practice should be to change your Maven 2.0.x configuration to use ~/.m2/repository/cache/releases as the local repository, and move the existing content, as this will co-exist properly with Maven 2.1. And share content for all releases (though snapshots will be installed in different locations).

Upgrade path

There is no need to upgrade existing local repositories - first use of Maven 2.1 will only mean users need to rebuild any local software, as remote artifacts will be redownloaded (however see above for the minimisation of this).

...

Though locking will now make this possible, it is still not a recommended practice to share the local repository. However, this structure will allow people to share the cache location safely to reduce disk usage if desired.

Settings

The above structure is a default, stored in the localRepository setting. However, snapshotLocalCache, releaseLocalCache and workspacesDirectory settings will be added to allow flexible location of those directories.

Implementation Considerations

...