<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 2, 2019 at 5:58 AM Wolfgang Knauf <<a href="mailto:wolfgang.knauf@gmx.de">wolfgang.knauf@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
just wanted to send a reminder about the questions below...<br>
<br>
Best regards<br>
<br>
Wolfgang<br>
<br>
Am 24.02.19 um 21:02 schrieb Wolfgang Knauf:<br>
> About problem b from below: I can think of two possibilities to resolve it:<br>
> <br>
> b.1) modify the qstools class "ArchetypeSyncMojo" so that it merges the <br>
> "kitchensink-ear" pom.xml and the quickstart pom into one file.<br>
> But I don't like the idea: The quickstarts root pom.xml has 778 lines - <br>
> this is way too much overhead for a newly created project. So I prefer...<br>
> <br>
> b.2) creating an archetype from scratch, with only "relevant" snippets <br>
> in pom.xml and discard the "copy automatically from kitchensink sample" <br>
> code.<br>
> <br>
> What do you think? Or is it possible to split the root pom file for the <br>
> quickstart into a bundle of feature sets? It seems maven does not <br>
> support this.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">TBH, I'm learning this stuff as I read these posts. I'd never heard of an <span style="font-family:Arial,Helvetica,sans-serif">ArchetypeSyncMojo before. ;) So it seems it ...</span></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">a) Deletes whatever is in src/main/resources/archetypes.</span></div><div class="gmail_default"><span style="font-family:Arial,Helvetica,sans-serif">b) Copies into src/main/resources/archetypes what's in </span><a href="https://github.com/wildfly/quickstart/tree/master/kitchensink-ear">https://github.com/wildfly/quickstart/tree/master/kitchensink-ear</a> (or whatever git repo the plugin config points to)</div><div class="gmail_default">c) Does some text replacement.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">I doubt we'd want to modify the quickstart code in any significant way, not unless Eduardo Martins wants to for some other reason. I get what you're saying though about how copying in the QS code means the new project pom would depend on the root QS pom, which is not usable. Even if we could work around the </font><relativePath>../pom.xml</relativePath> problem, I don't think users would want their app to have our QS root pom as its parent.</div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">And yes, your b.1 sounds like too much. I expect it would break regularly.</font></div>
<div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">AIUI your b.2 means decoupling the archetype from the QS code and instead directly having the app code in the wildfly-archetypes codebase. The downside to that is now there's another example app to maintain. (More than one really, as there would be one per archetype.)</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">I think the key thing is this would need to be low maintenance. The root QS depends on the wildfly-bom[1] so if there aren't a lot of version dependencies that would need to be in the archetype poms that will help. Is your impression that the archetype pom would be low maintenance?</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif">[1] <a href="https://github.com/wildfly/quickstart/blob/master/pom.xml#L109">https://github.com/wildfly/quickstart/blob/master/pom.xml#L109</a></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> Best regards<br>
> <br>
> Wolfgang<br>
> <br>
> Am 22.02.19 um 22:26 schrieb Wolfgang Knauf:<br>
>> Thanks for the reply, Brian. But before discussing the naming scheme, <br>
>> I would like to understand the concept of the old archetype creation <br>
>> and make it work again ;-).<br>
>><br>
>> I made some progress on the failing build, but now I reached a point <br>
>> where the concept "pulling from the kitchensink-ear app" seems to be <br>
>> broken by design....<br>
>><br>
>> To sum it up:<br>
>><br>
>> a) in the kitchensink sample, the names of the subdirectories ("ear", <br>
>> "ejb", "war") have changed. This causes the the archetype build to <br>
>> fail => this error is fixable, see below.<br>
>> But is it intended to provide an archetype with subdirectories "ear", <br>
>> "ejb" and "war" instead of "myapp-ear", "myapp-ejb" and "myapp-war"? I <br>
>> prefer the old naming scheme ;-).<br>
>><br>
>><br>
>> b) after fixing this, the archetype test will fail:<br>
>><br>
>> [ERROR] The project foo.bar:multi:[unknown-version] <br>
>> (C:\Temp\wildfly-archetypes\wildfly-javaee7-webapp-ear-archetype\target\test-classes\projects\multi\project\multi\pom.xml) <br>
>> has 1 error<br>
>> [ERROR] Non-resolvable parent POM for <br>
>> foo.bar:multi:[unknown-version]: Could not find artifact <br>
>> foo.bar:multi:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at <br>
>> wrong local POM @ line 21, column 13 -> [Help 2]<br>
>><br>
>><br>
>> The reason is the "relativePath" in "....\kitchensink-ear\pom.xml", <br>
>> which is the root pom in the archetype:<br>
>><br>
>><br>
>> <parent><br>
>> <groupId>org.wildfly.quickstarts</groupId><br>
>> <artifactId>quickstart-parent</artifactId><br>
>> <version>16.0.0.CR1-SNAPSHOT</version><br>
>> <relativePath>../pom.xml</relativePath><br>
>> </parent><br>
>><br>
>> ==>of course this parent file is not found in the generated archetype, <br>
>> thus it fails. This will make the archetype unusable.<br>
>><br>
>> How to resolve this problem? I don't think that it is a good idea to <br>
>> include all the stuff from the quickstart pom.xml - that's way too <br>
>> much for any user generated application. Keep it simple ;-).<br>
>><br>
>><br>
>> Best regards<br>
>><br>
>> Wolfgang<br>
>> ======================================<br>
>><br>
>> And now a detailed analysis of the first problem (broken build because <br>
>> of renamed directories) - for those who are interested in the details:<br>
>><br>
>><br>
>> When building the "wildfly-javaee7-webapp-ear-archetype", it fails <br>
>> with this error message:<br>
>><br>
>> [ERROR] Failed to execute goal <br>
>> org.apache.maven.plugins:maven-archetype-plugin:2.1:integration-test <br>
>> (default-integration-test) on project <br>
>> wildfly-javaee7-webapp-ear-archetype:<br>
>> [ERROR] Archetype IT 'multi' failed: <br>
>> org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error <br>
>> merging velocity templates: Unable to find resource <br>
>> 'archetype-resources/__rootArtifactId__-ejb/pom.xml'<br>
>><br>
>><br>
>> Taking a look at the files: in Git you find the files for the <br>
>> archetype in the subdir <br>
>> "wildfly-javaee7-webapp-ear-archetype/src/main/resources/archetype-resources/__rootArtifactId__-ejb" <br>
>><br>
>> (<a href="https://github.com/wildfly/wildfly-archetypes/tree/master/wildfly-javaee7-webapp-ear-archetype/src/main/resources/archetype-resources/__rootArtifactId__-ejb" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-archetypes/tree/master/wildfly-javaee7-webapp-ear-archetype/src/main/resources/archetype-resources/__rootArtifactId__-ejb</a>) <br>
>><br>
>> Those files shall be overwritten by the build: they are picked from <br>
>> the kitchensink sample and converted to a archetype version (with some <br>
>> placeholders like "${rootArtifactId}").<br>
>><br>
>> After the maven build has failed, <br>
>> "..../archetype-resources/__rootArtifactId__-ejb" contains only empty <br>
>> directories - all files inside are deleted.<br>
>> The files that are copied from the kitchensink-ear project are now in <br>
>> the directories "..../archetype-resources/ear", <br>
>> ".../archetype-resources/ejb", ".../archetype-resources/web".<br>
>> This is not the place where the tests expect it.<br>
>><br>
>> See attached screenshot "archetype_structure.png"<br>
>><br>
>><br>
>><br>
>> Now about the explanation:<br>
>> At the time of creation of this archetype project, the <br>
>> "kitchensink-ear" module had three submodules <br>
>> "wildfly-kitchensink-ear-ear", "wildfly-kitchensink-ear-ejb" and <br>
>> "wildfly-kitchensink-ear-web".<br>
>><br>
>> Here are old sources:<br>
>> <a href="https://github.com/wildfly/quickstart/tree/ed12afad407a2946b85db37bfeec1d2d1dd0201d/kitchensink-ear" rel="noreferrer" target="_blank">https://github.com/wildfly/quickstart/tree/ed12afad407a2946b85db37bfeec1d2d1dd0201d/kitchensink-ear</a> <br>
>><br>
>><br>
>><br>
>> In the file <br>
>> "wildfly-archetypes\wildfly-javaee7-webapp-archetype\pom.xml", there <br>
>> are defined several archetype replacement rules for the "qstools" <br>
>> plugin. One is this:<br>
>><br>
>> <archetypeExpressionReplaceValue>wildfly-kitchensink</archetypeExpressionReplaceValue> <br>
>><br>
>> This means: in all path components containing "wildfly-kitchensink" <br>
>> this will be replaced by "__rootArtifactId__"<br>
>> E.g. "wildfly-kitchensink-ear-ejb" will become <br>
>> ""__rootArtifactId__ear-ejb"<br>
>><br>
>><br>
>> See source code for the replacements at <br>
>> <a href="https://github.com/jboss-developer/maven-qstools-plugin/blob/master/src/main/java/org/jboss/maven/plugins/qstools/ArchetypeSyncMojo.java" rel="noreferrer" target="_blank">https://github.com/jboss-developer/maven-qstools-plugin/blob/master/src/main/java/org/jboss/maven/plugins/qstools/ArchetypeSyncMojo.java</a> <br>
>><br>
>><br>
>><br>
>> BUT the "kitchensink-ear" module has three submodules "ear", "ejb" and <br>
>> "web". So, no replacement occurs, and the files are copied to <br>
>> ".../archetype-resources/ejb" instead of <br>
>> ".../archetype-resources/__rootArtifactId__-ejb".<br>
>><br>
>><br>
>> This error is fixable if the file <br>
>> "...\wildfly-archetypes\wildfly-javaee7-webapp-ear-archetype\src\main\resources\META-INF\maven\archetype-metadata.xml" <br>
>><br>
>> is changed:<br>
>> replace<br>
>> <module id="ejb" dir="__rootArtifactId__-ejb" name="ejb"><br>
>> with:<br>
>> <module id="ejb" dir="ejb" name="ejb"><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> Am 22.02.19 um 05:05 schrieb Brian Stansberry:<br>
>>><br>
>>><br>
>>> On Wed, Feb 20, 2019 at 3:45 PM Wolfgang Knauf <<a href="mailto:wolfgang.knauf@gmx.de" target="_blank">wolfgang.knauf@gmx.de</a> <br>
>>> <mailto:<a href="mailto:wolfgang.knauf@gmx.de" target="_blank">wolfgang.knauf@gmx.de</a>>> wrote:<br>
>>><br>
>>> OK, after some digging around: the archetypes are generated based on<br>
>>> the<br>
>>> "Kitchensink" quickstart. So, actually there should be not much <br>
>>> changes<br>
>>> to the archetype files itself, just a "rebuild". But currently, a<br>
>>> "maven<br>
>>> install" for the archetype fails for me. More research needed...<br>
>>><br>
>>> Oops; I missed this post and responded to your first one! Thanks for <br>
>>> digging into this!<br>
>>><br>
>>> Wolfgang<br>
>>><br>
>>><br>
>>><br>
>>> Am 19.02.19 um 22:12 schrieb Wolfgang Knauf:<br>
>>> > Hi,<br>
>>> ><br>
>>> > the archetypes at <a href="https://github.com/wildfly/wildfly-archetypes" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-archetypes</a><br>
>>> > (e.g. "wildfly-javaee7-webapp-ear-blank-archetype") are for<br>
>>> WildFly 8,<br>
>>> > and when updating the WildFly version in pom.xmls, a lot of <br>
>>> further<br>
>>> > changes is required, see <br>
>>> <a href="https://issues.jboss.org/browse/WFLY-9703" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-9703</a><br>
>>> > (which is only part of the changes).<br>
>>> ><br>
>>> > I am interested in creating new archetypes for WildFly 15. What<br>
>>> do you<br>
>>> > think?<br>
>>> ><br>
>>> > My plan is to name them e.g.<br>
>>> > "wildfly15-javaee8-webapp-ear-blank-archetype" and to create a <br>
>>> new<br>
>>> > archetype version each time a new WildFly major version is <br>
>>> released.<br>
>>> ><br>
>>> > If you are OK with this, I will struggle with my first steps in<br>
>>> Git, and<br>
>>> > I probably will ask some more or less dumb questions about<br>
>>> details ;-).<br>
>>> ><br>
>>> > Best regards<br>
>>> ><br>
>>> > Wolfgang<br>
>>> > _______________________________________________<br>
>>> > wildfly-dev mailing list<br>
>>> > <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> <mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>><br>
>>> > <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
>>> ><br>
>>> _______________________________________________<br>
>>> wildfly-dev mailing list<br>
>>> <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> <mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>><br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
>>><br>
>>><br>
>>><br>
>>> -- <br>
>>> Brian Stansberry<br>
>>> Manager, Senior Principal Software Engineer<br>
>>> Red Hat<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Brian Stansberry<div>Manager, Senior Principal Software Engineer</div><div>Red Hat</div></div></div></div></div></div>