apache / apache/maven-dependency-plugin

[MDEP-458] overwriteIfNewer forces not needed overwrite of already existing artifacts

Open
#895 1 comment 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

**[Reguel Wermelinger](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=lordeagle)** opened **[MDEP-458](https://issues.apache.org/jira/browse/MDEP-458?redirect=false)** and commented

The __ property does not work for classifier _sources_ . As soon as the overWriteIfNever property is enabled, the artifacts with classifier "sources" are always overwritten. So not needed files are written very often to the disk.

The flag seems to work as expected for executions where no classifier is specified.

See the attached sample project where execution "thirdparty" can handle overwriteIfNever correctly. While the execution "thirdparty.sources" always copies files to the disk:

```xml
[INFO] --- maven-dependency-plugin:2.9-SNAPSHOT:copy-dependencies (thirdparty) @ ch.ivyteam.testarea.overwrite ---
[INFO] junit:junit:jar:3.8.1 already exists in destination.
[INFO]
[INFO] --- maven-dependency-plugin:2.9-SNAPSHOT:copy-dependencies (thirdparty.sources) @ ch.ivyteam.testarea.overwrite ---
[INFO] Copying junit-3.8.1-sources.jar to D:\dev\trunk\real_workspaceKepler\ch.ivyteam.testarea.overwrite\lib\mvn-src\junit-3.8.1-sources.jar
```

The not yet released version 2.9 in use was: maven-dependency-plugin-2.9-20140907.174645-631

---

**Affects:** 2.8, 2.9

**Attachments:**
- [overwriteIfNewer-sample.zip](https://issues.apache.org/jira/secure/attachment/12715121/overwriteIfNewer-sample.zip) (_270.36 kB_)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached overwriteIfNewer-sample.zip and compare the copy-dependencies executions "thirdparty" and "thirdparty.sources", focusing on how the sources classifier is handled. Verify the fix against the reported logs: with overwriteIfNever enabled, an existing sources artifact should not be copied again, while the no-classifier execution must retain its current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.