Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"[WARNING] CP Don't override file" when generating archetype with jboss-parent 40 #51

Open
WolfgangHG opened this issue Oct 4, 2023 · 3 comments

Comments

@WolfgangHG
Copy link
Contributor

During the build process, there are warnings printed after updating to jboss-parent 40:

[INFO] --- archetype:3.2.1:integration-test (default-integration-test) @ wildfly-jakartaee-ear-archetype ---
[INFO] Processing Archetype IT project: multi
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: wildfly-jakartaee-ear-archetype:30.0.0.Final-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: foo.bar
[INFO] Parameter: artifactId, Value: multi
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: package, Value: foo.bar.multi
[INFO] Parameter: packageInPathFormat, Value: foo/bar/multi
[INFO] Parameter: package, Value: foo.bar.multi
[INFO] Parameter: groupId, Value: foo.bar
[INFO] Parameter: artifactId, Value: multi
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\ejb\pom.xml
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\web\pom.xml
[WARNING] Don't override file C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\web\src\test\java\foo\bar\multi
[WARNING] CP Don't override file C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\web\src\main\webapp
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\ear\pom.xml
[INFO] Project created from Archetype in dir: C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi
[INFO] Invoking post-archetype-generation goals: verify

They are not shown with 39:

[INFO] --- archetype:3.1.2:integration-test (default-integration-test) @ wildfly-jakartaee-ear-archetype ---
[INFO] Processing Archetype IT project: multi
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: wildfly-jakartaee-ear-archetype:30.0.0.Final-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: foo.bar
[INFO] Parameter: artifactId, Value: multi
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: package, Value: foo.bar.multi
[INFO] Parameter: packageInPathFormat, Value: foo/bar/multi
[INFO] Parameter: package, Value: foo.bar.multi
[INFO] Parameter: groupId, Value: foo.bar
[INFO] Parameter: artifactId, Value: multi
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\ejb\pom.xml
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\web\pom.xml
[INFO] Parent element not overwritten in C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi\ear\pom.xml
[INFO] Project created from Archetype in dir: C:\Temp\github\wildfly-archetypes\wildfly-jakartaee-ear-archetype\target\test-classes\projects\multi\project\multi
[INFO] Invoking post-archetype-generation goals: verify

The archetype plugin was updated from 3.1.2 to 3.2.1, which seems to cause this issue.

According to some web research, the reason might be that some filesets in the archetype-metadata.xml are overlapping. I will do further research.

@WolfgangHG
Copy link
Contributor Author

WolfgangHG commented Oct 4, 2023

The problem seems to be caused in the moment when the archetype is created and depends on the archetype plugin version.
When generating a project from the archetype with debug logging, I can see that the jar file of the archetype contains much more entries after having build it with jboss-parent 40 (which uses archetype plugin 3.2.1). Those additional entries seem to be directory entries.

Here is the log for a "archetype:generate" output, when the archetype is built with maven-archetype-plugin 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

And this is the log output, when the archetype was built with jboss-parent 39 (archetype plugin 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

The jar files differ also in size.

The method "getFilesetArchetypeResources" is found here. It simply reads the zip entries.
So I assume that duplicate entries cause the duplicate warning.

@WolfgangHG
Copy link
Contributor Author

Created https://issues.apache.org/jira/browse/ARCHETYPE-649 - let's see if there is some feedback.

@WolfgangHG
Copy link
Contributor Author

archetype-plugin 3.3.0 brings a new problem: logging of the archetype verification is no longer reported, which is confusing as there is just a long delay after the line "Invoking post-archetype-generation goals: verify" is printed, and you won't see errors that happen during building of the sample project:

https://issues.apache.org/jira/browse/ARCHETYPE-681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant