Reputation: 28885
We are using the dependency:copy
goal of Apache Maven Dependency Plugin which has three overwrite settings:
overWriteIfNewer
: Overwrite if neweroverWriteReleases
: Overwrite release artifactsoverWriteSnapshots
: Overwrite snapshot artifactsThe only documentation I've found are the short sentences above.
When do these settings count, when do they produce different output? What are the use-cases of these settings? What should I consider before setting them true
or false
?
Upvotes: 4
Views: 2791
Reputation: 14782
See the Overwrite Rules on the plugin's Usage page:
Artifacts are copied or unpacked using the following rules:
If the artifact doesn't exist in the destination, then copy/unpack it.
Otherwise:
For copy/unpack mojo only: if
artifactItem / overWrite
oroverWrite
is true, then it will force an overwrite.- Releases check the
overWriteReleases
value (default = false). If true, then it will force an overwrite.- Snapshots check the
overWriteSnapshots
value (default = false). If true, then it will force an overwrite.- If none of the above is set to true, then it defaults to the
overWriteIfNewer
value (default = true). This value, if true, causes the plugin to only copy if the source is newer than the destination (or it doesn't exist in the destination). (for unpack, this checks the existence of the marker file, created in themarkersDirectory
path. To avoid unexpected behavior aftermvn clean
, this path should normally be contained within the/target
hierarchy.)Examples:
- ...
Upvotes: 6