apache / apache/maven-archetype
[ARCHETYPE-649] "[WARNING] CP Don't override file" when generating archetype with 3.2.1
- Dominant language
- Java
- Stars
- 148
- Forks
- 181
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 8
Description
**[Wolfgang Knauf](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=wknauf)** opened **[ARCHETYPE-649](https://issues.apache.org/jira/browse/ARCHETYPE-649?redirect=false)** and commented
I do some maintenance work on the "wildfly-jakartaee-ear-archetype". After updating "maven-archetype-plugin" to 3.2.1, there are two warnings printed when creating a project from the archetype.
> `[WARNING] Don't override file ...\multi\project\multi\web\src\test\java\foo\bar\multi`
> `[WARNING] CP Don't override file ...\multi\project\multi\web\src\main\webapp`
>
I think the problem depends on the archetype-plugin version that creates the archetype JAR. Attached are the jar files from my local repository. One is created with archetype-plugin 3.1.2, the other with 3.2.1.
[^wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_321.jar]
[^wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_312.jar]
Note the size difference of the two jar files.
When creating a project from the archetype, the message appears with both 3.1.2 and 3.2.1, if the archetype jar was created with 3.2.1. It does not appear when the archetype jar was created with the 3.1.2 plugin.
Debug logging during generating of the project from the archetype seems to point me to the reason: with 3.2.1, the jar file contains a lot of entries for the directories. With 3.1.2, there are only entries for "real" files.
This seems to cause duplicates with the fileSets in "archetype-metadata.xml"
Here is the log when the archetype jar was created with 3.1.2:
`[DEBUG] getFilesetArchetypeResources( "C:\Users\USERNAME\.m2\repository\org\wildfly\archetype\wildfly-jakartaee-ear-archetype\30.0.0.Final-SNAPSHOT\wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT.jar" )`
`[DEBUG] - found resource (archetype-resources/)ear/pom.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/pom.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/src/main/resources/META-INF/persistence.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/src/test/resources/arquillian.xml`
`[DEBUG] - found resource (archetype-resources/)pom.xml`
`[DEBUG] - found resource (archetype-resources/)README.txt`
`[DEBUG] - found resource (archetype-resources/)web/pom.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/WEB-INF/beans.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/WEB-INF/faces-config.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/test/java/test/SampleIT.java`
`[DEBUG] - found resource (archetype-resources/)web/src/test/resources/arquillian.xml`
`[DEBUG] - ignored resource META-INF/maven/archetype-metadata.xml`
`[DEBUG] Processing complete archetype wildfly-jakartaee-webapp-ear-archetype`
And this is the output for an archetype created with 3.2.1:
`[DEBUG] getFilesetArchetypeResources( "C:\Users\USERNAME\.m2\repository\org\wildfly\archetype\wildfly-jakartaee-ear-archetype\30.0.0.Final-SNAPSHOT\wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT.jar" )`
`[DEBUG] - ignored resource META-INF/MANIFEST.MF`
`[DEBUG] - ignored resource META-INF/`
`[DEBUG] - found resource (archetype-resources/)`
`[DEBUG] - found resource (archetype-resources/)ear/`
`[DEBUG] - found resource (archetype-resources/)ejb/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/main/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/main/resources/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/main/resources/META-INF/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/test/`
`[DEBUG] - found resource (archetype-resources/)ejb/src/test/resources/`
`[DEBUG] - found resource (archetype-resources/)web/`
`[DEBUG] - found resource (archetype-resources/)web/src/`
`[DEBUG] - found resource (archetype-resources/)web/src/main/`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/WEB-INF/`
`[DEBUG] - found resource (archetype-resources/)web/src/test/`
`[DEBUG] - found resource (archetype-resources/)web/src/test/java/`
`[DEBUG] - found resource (archetype-resources/)web/src/test/java/test/`
`[DEBUG] - found resource (archetype-resources/)web/src/test/resources/`
`[DEBUG] - ignored resource META-INF/maven/`
`[DEBUG] - ignored resource META-INF/maven/org.wildfly.archetype/`
`[DEBUG] - ignored resource META-INF/maven/org.wildfly.archetype/wildfly-jakartaee-ear-archetype/`
`[DEBUG] - found resource (archetype-resources/)ear/pom.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/pom.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/src/main/resources/META-INF/persistence.xml`
`[DEBUG] - found resource (archetype-resources/)ejb/src/test/resources/arquillian.xml`
`[DEBUG] - found resource (archetype-resources/)pom.xml`
`[DEBUG] - found resource (archetype-resources/)README.txt`
`[DEBUG] - found resource (archetype-resources/)web/pom.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/WEB-INF/beans.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/main/webapp/WEB-INF/faces-config.xml`
`[DEBUG] - found resource (archetype-resources/)web/src/test/java/test/SampleIT.java`
`[DEBUG] - found resource (archetype-resources/)web/src/test/resources/arquillian.xml`
`[DEBUG] - ignored resource META-INF/maven/archetype-metadata.xml`
`[DEBUG] - ignored resource META-INF/maven/org.wildfly.archetype/wildfly-jakartaee-ear-archetype/pom.xml`
`[DEBUG] - ignored resource META-INF/maven/org.wildfly.archetype/wildfly-jakartaee-ear-archetype/pom.properties`
Unfortunately, I don't have an easy to reproduce sample - the "[wildfly-jakartaee-ear-archetype](https://github.com/wildfly/wildfly-archetypes)" contains some additional stuff.
For completeness, I attached[^archetype-metadata.xml] with several "fileSet" definitions.
---
**Affects:** 3.2.1
**Attachments:**
- [archetype-metadata.xml](https://issues.apache.org/jira/secure/attachment/13063362/archetype-metadata.xml) (_3.36 kB_)
- [wildfly-jakartaee-ear-archetype_ARCHETYPE-649.zip](https://issues.apache.org/jira/secure/attachment/13063377/wildfly-jakartaee-ear-archetype_ARCHETYPE-649.zip) (_25.79 kB_)
- [wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_312.jar](https://issues.apache.org/jira/secure/attachment/13063364/wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_312.jar) (_15.90 kB_)
- [wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_321.jar](https://issues.apache.org/jira/secure/attachment/13063363/wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_321.jar) (_20.92 kB_)
**Remote Links:**
- [GitHub Pull Request #160
](https://github.com/apache/maven-archetype/pull/160)
Contributor guide
No contributing guide indexed for this repository
Research direction
Compare the attached 3.1.2 and 3.2.1 archetype JARs with archetype-metadata.xml, starting from the getFilesetArchetypeResources output. Check how directory entries interact with the fileSet definitions and verify that generating the project no longer reports duplicate "Don't override file" warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100