palacsint
palacsint

Reputation: 28885

Overwrite settings of Apache Maven Dependency Plugin

We are using the dependency:copy goal of Apache Maven Dependency Plugin which has three overwrite settings:

The 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

Answers (1)

Gerold Broser
Gerold Broser

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 or overWrite 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 the markersDirectory path. To avoid unexpected behavior after mvn clean, this path should normally be contained within the /target hierarchy.)

Examples:

  • ...

Upvotes: 6

Related Questions