[FORGE-5] Maven archetypes for Magnolia modules and projects Created: 19/Oct/10  Updated: 26/Feb/18  Resolved: 21/Dec/10

Status: Closed
Project: Forge

Type: Project registration Priority: Major
Reporter: Joerg Bellmann Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None

Attachments: PNG File magnolia-module-archetype-1.1.0-SNAPSHOT.png    
Issue Links:
relation
is related to ARCH-12 Improve and update archetypes Closed
Project Name: Magnolia Maven Archetypes
Project Short Name: magnolia-maven-archetypes
Project Description: Provides Maven archetypes for Magnolia modules and projects
Developers:
Magnolia International, Tobias Mattsson
Project SCM: Git (git.magnolia-cms.com)
Project Jira key: ARCH
Project Maven groupID: info.magnolia.maven.archetypes
Project License: APACHE LICENSE

 Comments   
Comment by Magnolia International [ 21/Oct/10 ]

Hi Joerg, we already have a couple of oudated/unfinished archetypes at http://svn.magnolia-cms.com/svn/community/archetypes/trunk/ - would like to look at them, maintain or patch them, or create something entirely different ?

Comment by Joerg Bellmann [ 22/Oct/10 ]

Hi Grégory, sorry I missed the MPARCH-project. So I will see what I can do in the MPARCH-project to patch and maintain the archetypes there.

Comment by Magnolia International [ 22/Oct/10 ]

Cool, no problem. I've been wanting to tackle these for a while, but haven't, for lack of time. Would be great if you could send a few patches in, or write down a few of your thoughts/ideas (in MPARCH would probably be the best place) - commit rights will follow if we see we have the same ideas (most likely)

Comment by Magnolia International [ 21/Dec/10 ]

Joerg, I went ahead and opened a forge space for you. Don't hesitate to ping me personally via email or else as soon as you've committed something in there - I'll have a quick check and hopefully we can merge efforts !

We have created a directory for you on our Subversion repository; you can browse it at http://svn.magnolia-cms.com/view/forge/magnolia-maven-archetypes, or check out a local copy with:
svn checkout http://svn.magnolia-cms.com/svn/forge/magnolia-maven-archetypes/trunk

We also prepared a Jira project for you; it's available at http://jira.magnolia-cms.com/browse/MPARCH.

Since you provided us with a Maven groupId (info.magnolia.maven.archetypes), we also registered you as a developer for that group on our Nexus instance.

More details about the infrastructure are available for you at http://forge.magnolia-cms.com/.

Comment by Joerg Bellmann [ 02/Jan/11 ]

Hi Grégory, did some checkins to svn for the module-archetype and deployed the snapshot to nexus. For a quick start do the following:

mvn archetype:generate -DarchetypeCatalog=http://svn.magnolia-cms.com/svn/forge/magnolia-maven-archetypes/archetypes/archetype-catalog.xml

The full output should be:

jbellmann@belloNotebook:~/dev/work/magnolia/test$ mvn archetype:generate -DarchetypeCatalog=http://svn.magnolia-cms.com/svn/forge/magnolia-maven-archetypes/archetypes/archetype-catalog.xml
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:2.0-alpha-5:generate (default-cli) @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:2.0-alpha-5:generate (default-cli) @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:2.0-alpha-5:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://svn.magnolia-cms.com/svn/forge/magnolia-maven-archetypes/archetypes/archetype-catalog.xml -> magnolia-module-archetype (Archetype for magnolia modules.)
Choose a number: : 1
Downloading: http://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/info/magnolia/maven/archetypes/magnolia-module-archetype/1.1.0-SNAPSHOT/maven-metadata.xml
Downloaded: http://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/info/magnolia/maven/archetypes/magnolia-module-archetype/1.1.0-SNAPSHOT/maven-metadata.xml (805 B at 2.3 KB/sec)
Downloading: http://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/info/magnolia/maven/archetypes/magnolia-module-archetype/1.1.0-SNAPSHOT/magnolia-module-archetype-1.1.0-20101230.132529-4.jar
Downloaded: http://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/info/magnolia/maven/archetypes/magnolia-module-archetype/1.1.0-SNAPSHOT/magnolia-module-archetype-1.1.0-20101230.132529-4.jar (3 KB at 13.6 KB/sec)
Define value for property 'groupId': : com.mycompany.magnolia
Define value for property 'artifactId': : first-module
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  com.mycompany.magnolia: : 
Define value for property 'module-name':  first-module: : 
Confirm properties configuration:
groupId: com.mycompany.magnolia
artifactId: first-module
version: 1.0-SNAPSHOT
package: com.mycompany.magnolia
module-name: first-module
 Y: : Y
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:13.819s
[INFO] Finished at: Sun Jan 02 20:31:25 CET 2011
[INFO] Final Memory: 7M/245M
[INFO] ------------------------------------------------------------------------
jbellmann@belloNotebook:~/dev/work/magnolia/test$ 

This was the first shot. After your check we can go further to improve it.

HAPPY NEW YEAR

Comment by Magnolia International [ 07/Jan/11 ]

Hi Joerg,

Looks good. Few remarks:

  • sort dependencies in the pom for clarity (core first, test last)
  • i would not add dependencies to stk/etk by default
  • configure the releases/snapshots properties for the <repositories> element

I'm looking into adding an archetype-plugin to Nexus, so we don't have to manually maintain the list.

Thanks !

Comment by Magnolia International [ 07/Jan/11 ]

OK, archetype plugin added to nexus, you can now do:

mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/archetype-catalog.xml

Unfortunately, it looks like the archetype plugin does not honor the mirror settings from the settings.xml.

Comment by Joerg Bellmann [ 07/Jan/11 ]

Hi Grégory,
I made the changes you mentioned in the comment above. Lets go further:

  • what was the other archetype (webapp?) that were in svn?
  • should we invest in that archetype?
  • where is documentation in the wiki to update, or should we create a new page in the wiki?
  • other improvements?

Joerg

Comment by Magnolia International [ 11/Jan/11 ]

Excellent.
The other archetype, webapp, is meant to be a quickstart to build a Magnolia-based war, i.e dependency on the empty-webapp, with some known quirks in the pom.xml (see svn/community/projects for examples)

It's perhaps better changed to a "project" archetype, i.e a multi-module build that has one magnolia-module and such a webapp as child projects. WDYT ?

As for documentation, that would be great ! I suggest updating pages currently referring to the archetype http://wiki.magnolia-cms.com/dosearchsite.action?queryString=archetype

And as for other improvements, be my guest ! I'm sure you have good ideas to put into this. Perhaps we could cut a first release as-is and merge your work with /svn/community/archetypes/ first. Let me know what you think.

Comment by Magnolia International [ 25/Jan/11 ]

Just a thought that came through my head: it would be nice to have an archetype for STK themes, too. They're essentially modules, but using a specific version handler, a themeName property in the module descriptor, and a few more specific folders for css and js.

Comment by Magnolia International [ 17/Mar/11 ]

Joerg, I created a new Jira project, and migrated issues from the old MPARCH project into this new one. I'll go through existing issues now and close as appropriate.

http://jira.magnolia-cms.com/browse/ARCH

Comment by Magnolia International [ 23/Sep/13 ]

Moved to Git under build/magnolia-maven-archetypes

Generated at Mon Feb 12 01:56:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.