apache / apache/maven-archetype

[ARCHETYPE-566] Partial archetype fails on existing structure

Open
#800 0 comments 0 reactions 0 assignees View on GitHub
bug priority:trivial
Dominant language
Java
Stars
148
Forks
181
Avg merge
1d 20h
Merged PRs (30d)
8

Description

**[Pierre Remazeilles](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=peteus)** opened **[ARCHETYPE-566](https://issues.apache.org/jira/browse/ARCHETYPE-566?redirect=false)** and commented

Greetings,

When generating a partial archetype on an existing project which already contains some of its files, the generation fails with the message "Don't override file".

However, given the code, the generation should not fail in this case, but rather display a warning message. It seems the problem lies in the fact that the "failIfExists" parameter is inverted in the methods "processArchetypeTemplates" and "processArchetypeTemplatesWithWarning". I think "failIfExists" should be false for "processArchetypeTemplatesWithWarning" (as the method name would imply), and true for "processArchetypeTemplates". This is currently the opposite.

---

**Affects:** 3.1.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the processArchetypeTemplates and processArchetypeTemplatesWithWarning methods in the Maven Archetype plugin and trace how they pass failIfExists during partial generation. Reproduce generation against an existing project with overlapping files, then verify that the warning path no longer fails while the normal path retains its intended failure behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.