Wolfgang Knauf created ARCHETYPE-649:
----------------------------------------
Summary: "[WARNING] CP Don't override file" when generating
archetype with 3.2.1
Key: ARCHETYPE-649
URL: https://issues.apache.org/jira/browse/ARCHETYPE-649
Project: Maven Archetype
Issue Type: Bug
Components: Creator
Affects Versions: 3.2.1
Reporter: Wolfgang Knauf
Attachments: archetype-metadata.xml,
wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_312.jar,
wildfly-jakartaee-ear-archetype-30.0.0.Final-SNAPSHOT_321.jar
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.
{quote}{{[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}}{quote}
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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)