...
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 |
workspace | contains a directory for each local workspace, with the primary one being |
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
...