cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject [C3] Working with archetypes [Was Re: parent of parent artifact?]
Date Thu, 08 Mar 2012 09:49:09 GMT
Hi all,
taking inspiration from Robby's e-mail, I spent some time trying to
figure out how to make [1] working with latest version
(3.0.0-beta-1-SNAPSHOT).
I've also made some fixes, committed and deployed, so now everything
should be working.
You don't need to checkout C3 sources, since latest versions are already
available in ASF snapshot repository.

Premise: I might be wrong in some detail because I don't know the
original reasons behind the way how archetypes are structured: if so, I
ask other committers to please correct me.

A) If you just want to take a look at C3 samples, just run

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.cocoon.archetype-sample \
    -DarchetypeArtifactId=cocoon-archetype-sample \
    -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
    -DgroupId=com.mycompany \
    -DartifactId=mysample \
    -Dversion=1.0-SNAPSHOT \
   
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/

and then

cd mysample
mvn jetty:run

Now point your browser to http://localhost:8888 and enjoy C3 samples.

B) If you just want to develop your own block

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.cocoon.archetype-block \
    -DarchetypeArtifactId=cocoon-archetype-block \
    -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
    -DgroupId=com.mycompany \
    -DartifactId=mysite \
    -Dversion=1.0-SNAPSHOT \
   
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/

and then

cd mysite
mvn jetty:run

Now point your browser to http://localhost:8888 and enjoy your (almost
empty) C3 block.

C) If you want to develop a complete C3 web application

You need to generate a multimodule maven project [2] with the following
structure:

myparent/
    mysite/
    mywebapp/

Basically, you will need this when either having multiple blocks on a
single webapp or when you want to deploy on an external web container
(say Tomcat).

In order to generate such multimodule project you need to

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.cocoon.archetype-parent \
    -DarchetypeArtifactId=cocoon-archetype-parent \
    -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
    -DgroupId=com.mycompany \
    -DartifactId=myparent \
    -Dversion=1.0-SNAPSHOT \
   
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/

then

cd myparent

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.cocoon.archetype-block \
    -DarchetypeArtifactId=cocoon-archetype-block \
    -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
    -DgroupId=com.mycompany \
    -DartifactId=mysite \
    -Dversion=1.0-SNAPSHOT \
   
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.cocoon.archetype-webapp \
    -DarchetypeArtifactId=cocoon-archetype-webapp \
    -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
    -DgroupId=com.mycompany \
    -DartifactId=mywebapp \
    -Dversion=1.0-SNAPSHOT \
   
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/

Now you can finally

cd mywebapp
mvn jetty:run

I hope this helps.
Please indicate if there is something to complete / correct.

Regards.

[1] http://cocoon.apache.org/3.0/download.html
[2] http://maven.apache.org/guides/mini/guide-multiple-modules.html

-- 
Francesco Chicchiriccò

Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


Mime
View raw message