[ARCH-43] Update 'magnolia-module-archetype' to reflect Magnolia 5.4 folders structure Created: 27/Apr/15  Updated: 11/Apr/18  Resolved: 08/Dec/15

Status: Closed
Project: Archetypes
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.3

Type: Task Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: 0d
Time Spent: 5h
Original Estimate: Not Specified

Issue Links:
relation
is related to ARCH-45 Please remove Maven 2 leftowers Closed
is related to ARCH-46 Update 'magnolia-project-archetype' Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Sprint: Basel 23
Story Points: 3

 Description   

Update 'magnolia-module-archetype' to reflect Magnolia 5.4 folders structure to make sure it creates a Magnolia Module according to Magnolia 5.4 Module structure .

Also raise java version to 1.8 (ARCH-50) 1.7.



 Comments   
Comment by Ismail Bay [ 10/Aug/15 ]

Hello,

Any plans on this issue?

Comment by Florian Fuchs [ 17/Oct/15 ]

Instead of archetypes, you could offer a bunch of sample projects on github - just like spring boot is doing.

If magnolia sticks to archetypes - please update them to reflect 5.4. (e.g. with an app archetype)

Comment by Christoph Meier [ 07/Dec/15 ]

Right now, when using archetype option 1 - An archetype to create basic Magnolia modules - it creates the following structure:

example-module/
├── pom.xml
└── src
    └── main
        ├── java
        │   └── example
        │       └── com
        │           ├── ExampleModule.java
        │           └── setup
        │               └── ExampleModuleVersionHandler.java
        └── resources
            ├── META-INF
            │   └── magnolia
            │       └── example-module.xml
            ├── example-module
            │   ├── components
            │   └── pages
            ├── mgnl-bootstrap
            │   └── example-module
            ├── mgnl-bootstrap-samples
            │   └── example-module
            ├── mgnl-files
            │   ├── docroot
            │   │   └── example-module
            │   └── templates
            │       └── example-module
            └── mgnl-resources
                └── example-module

However, it should produce what is mentioned on the page Module structure

I think it could be helpful also to provide a super simple page template and a super simple component template at appropriate locations.

Comment by Christoph Meier [ 08/Dec/15 ]

I have changed magnolia-module-archetype in a way that it reflects the 5.4 folder structure.
Legacy folders (mgnl-files, mgnl-ressources) have been removed.
Additionally, i added 2 dummy templates (one page with one component) with one dialog. Not sure whether this is eligible or rather cumbersome (ideally a user could choose during the execution of the archetype wthether he wants the dummy templates or not).

Comment by Philip Mundt [ 16/Dec/15 ]

Please note that the output of the generation now comes with additional warnings:

From archetype magnolia-module-archetype:1.2.2

[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: magnolia-module-archetype:1.2.2
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: info.magnolia.test
[INFO] Parameter: artifactId, Value: another-test-module
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: info.magnolia.test
[INFO] Parameter: packageInPathFormat, Value: info/magnolia/test
[INFO] Parameter: magnolia-version, Value: 5.4.4-SNAPSHOT
[INFO] Parameter: module-class-name, Value: AnotherTestClass
[INFO] Parameter: package, Value: info.magnolia.test
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: info.magnolia.test
[INFO] Parameter: module-name, Value: another-test-module
[INFO] Parameter: artifactId, Value: another-test-module
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-other-test-project/another-test-module/src/main/resources/META-INF/magnolia/another-test-module.xml
[INFO] project created from Archetype in dir: /Users/johndoe/Code_Magnolia/git/tmp/the-other-test-project/another-test-module
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] the-other-test-project (parent pom) ................ SUCCESS [ 43.052 s]
[INFO] the-other-test-project: webapp ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.334 s
[INFO] Finished at: 2015-12-16T08:47:01+01:00
[INFO] Final Memory: 16M/220M
[INFO] ------------------------------------------------------------------------

From archetype magnolia-module-archetype:1.2.3-SNAPSHOT

[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: magnolia-module-archetype:1.2.3-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: info.magnolia.test
[INFO] Parameter: artifactId, Value: test-module
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: info.magnolia.test
[INFO] Parameter: packageInPathFormat, Value: info/magnolia/test
[INFO] Parameter: magnolia-version, Value: 5.4.4-SNAPSHOT
[INFO] Parameter: module-class-name, Value: TestModule
[INFO] Parameter: package, Value: info.magnolia.test
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: info.magnolia.test
[INFO] Parameter: module-name, Value: test-module
[INFO] Parameter: artifactId, Value: test-module
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/test-module/dialogs/pages/dummy-page-properties.yaml
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/test-module/templates/components/dummy-component.ftl
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/test-module/templates/components/dummy-component.yaml
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/test-module/templates/pages/dummy-page.ftl
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/test-module/templates/pages/dummy-page.yaml
[WARNING] CP Don't override file /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module/src/main/resources/META-INF/magnolia/test-module.xml
[INFO] project created from Archetype in dir: /Users/johndoe/Code_Magnolia/git/tmp/the-test-project/test-module
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] the-test-project (parent pom) ...................... SUCCESS [ 39.105 s]
[INFO] the-test-project: webapp ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.397 s
[INFO] Finished at: 2015-12-15T15:39:27+01:00
[INFO] Final Memory: 16M/184M
[INFO] ------------------------------------------------------------------------

Notice the WARNING in the output...

Generated at Sun Feb 11 23:22:58 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.