On 15/03/2012 23:08, Lars Huttar wrote:
Francesco,

I've been following your instructions below, starting from C). It all seems to work well, but when I get down to "mvn jetty:run", I get the following error: [ERROR] Failed to execute goal org.mortbay.jetty:maven-jetty-plugin:6.1.26:run ( default-cli) on project theWebapp: Webapp source directory C:\Users\HuttarL\Docu ments\work\c3\theParent\theWebapp\target\theWebapp-1.0-SNAPSHOT does not exist -
> [Help 1]

(I changed "my" to "the" in folder names... minor cosmetic detail.)

I look, and it's true:
     theParent\theWebapp\target\
does not contain a folder named "theWebapp-1.0-SNAPSHOT". It only contains a folder named "classes". But I don't understand the mvn process well enough to know why such a folder is expected, or how to fix the problem.

Lars,
you are right: first of all, yesterday I've fixed some minor errors on C3 archetypes; moreover, there are some errors in the instructions C reported below.

Basically, once you've generated all projects and indicated below, you have to

Add this to mywebapp/pom.xml, right before <build>...</build> (you need this because you are telling to mywebapp that it has to include mysite, i.e. an empty C3 block - you can of course add more of such blocks, as indicated by Thorsten in one of former e-mails):

<dependencies>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>mysite</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

then

mvn clean package

and only finally

cd mywebapp
mvn jetty:run

You can also deploy the generated mywebapp/target/mywebapp-1.0-SNAPSHOT.war to an external container, like as Tomcat.

I've just re-tested everything and it seems to work: for your reference, I've pushed and empty project, generated by following these updated instructions, at [1].

Let me know if it works.
Regards.

[1] https://github.com/ilgrosso/cocoon3EmptyProject

On 3/8/2012 3:49 AM, Francesco Chicchiriccò wrote:
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/



--
Francesco Chicchiriccò

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

Reply via email to