You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Legg <da...@searchevent.co.uk> on 2008/06/17 13:06:30 UTC

Tutorial improvement suggestion

Just thought I'd mention a tiny improvement that could be made to the 
"Your first Cocoon application using Maven 2" [1] web page.

The section titled "Creating a block" gives a maven command which uses 
the deprecated goal "archetype:create" instead of "archetype:generate" 
leading to the following disconcerting message during the build: -

  [INFO] [archetype:create]
  [WARNING] This goal is deprecated. Please use mvn archetype:generate 
instead

If I use archetype:generate instead then Maven interactively asks me 
some questions I have to guess the answers to ;-)

Regards,
David Legg


[1] http://cocoon.zones.apache.org/dev-docs/2.2/1159_1_1.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tutorial improvement suggestion

Posted by David Legg <da...@searchevent.co.uk>.
> Thanks for taking care of creating of this file. However, if we are 
> going to upload it to our site we need an explicit sign of 
> contribution for legal reasons. Therefore I would like to ask you to 
> create a JIRA issue and attach your file to it. Then we can proceed.

No problem.  I have created COCOON-2214 [1]

>> This page isn't easy to find so there should at least be a link to it 
>> from the tutorial pages.
>
> David, what about the link in the horizontal menu below search field?

Doh!  Where'd that come from ;-)

Thanks for the information about how to contribute.  I've signed up.

Regards,
David Legg

[1] https://issues.apache.org/jira/browse/COCOON-2214


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tutorial improvement suggestion

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
David Legg pisze:
> Grek,
> 
>> The only missing thing is the actual archetype catalog XML file. 
>> David, would you like to prepare own? I'm not sure how archetype 
>> plug-in supports this file generation but even if support is bad you 
>> could always prepare the catalog by hand (fortunately enough, the list 
>> is not long for us).
> 
> I've generated the archetype catalog.  I've attached it to this email.  
> It wasn't too difficult... just had to run "mvn archetype:crawl" and it 
> placed the new file in my local repository 
> ([MAVEN_REPO]/.m2/repository/archetype-catalog.xml).  I then edited this 
> manually to change the order of the archetypes listed from simplest to 
> most complex and added some human understandable descriptions.  I've 
> confirmed that the following command works with a local copy of the 
> catalog: -
> 
>  mvn archetype:generate 
> -DarchetypeCatalog=file://c:\temp\archetype-catalog.xml
> 
> and generates the following interactive questions: -
> 
>  [INFO] Scanning for projects...
>  [INFO] Searching repository for plugin with prefix: 'archetype'.
>  ...
>  [INFO] [archetype:generate]
>  [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: local -> cocoon-22-archetype-block-plain (Creates an empty Cocoon 
> block)
>  2: local -> cocoon-22-archetype-block (Creates a minimal Cocoon block)
>  3: local -> cocoon-22-archetype-webapp (Creates a web application 
> Cocoon block)
>  Choose a number:  (1/2/3): Choose archetype:
> 
> There is a caveat though.  I noticed on the Maven bug list [3] that some 
> earlier versions of the plugin didn't handle local or remote catalog 
> files.  However this seems to have been fixed in the 2.0 alpha-3 version.

AFAIK, Maven will pick up the latest version so that's not a problem.

Thanks for taking care of creating of this file. However, if we are going to upload it to our site 
we need an explicit sign of contribution for legal reasons. Therefore I would like to ask you to 
create a JIRA issue[4] and attach your file to it. Then we can proceed.

> So if someone would place this file on the site and update the 
> documentation page we should be good to go.  I registered on the Cocoon 
> documentation site [2] to see if I could update the pages myself but 
> quickly discovered this doesn't let me actually create or edit the 
> documentation :-(

Take a look at:
http://cocoon.apache.org/1273_1_1.html

There you find instructions how to contribute to the documentation.

> Of course this file will have to be updated from time to time.

Yep, every time new archetype is being released but it's not a big deal.

> I have a feeling that Reinhard Pötz is our man for this ;-)  He authored 
> the Maven archetype plugin list [2].  This page isn't easy to find so 
> there should at least be a link to it from the tutorial pages.

David, what about the link in the horizontal menu below search field?

BTW We try to avoid establishing desolated islands of the responsibility/interest. Even though 
Reinhard's huge work is undeniable there are other folks that can share the responsibility. That's 
how community should work.

[4] https://issues.apache.org/jira/browse/COCOON

Thanks again for your sweet work!

-- 
Best regards,
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tutorial improvement suggestion

Posted by David Legg <da...@searchevent.co.uk>.
Grek,

> The only missing thing is the actual archetype catalog XML file. 
> David, would you like to prepare own? I'm not sure how archetype 
> plug-in supports this file generation but even if support is bad you 
> could always prepare the catalog by hand (fortunately enough, the list 
> is not long for us).

I've generated the archetype catalog.  I've attached it to this email.  
It wasn't too difficult... just had to run "mvn archetype:crawl" and it 
placed the new file in my local repository 
([MAVEN_REPO]/.m2/repository/archetype-catalog.xml).  I then edited this 
manually to change the order of the archetypes listed from simplest to 
most complex and added some human understandable descriptions.  I've 
confirmed that the following command works with a local copy of the 
catalog: -

  mvn archetype:generate 
-DarchetypeCatalog=file://c:\temp\archetype-catalog.xml

and generates the following interactive questions: -

  [INFO] Scanning for projects...
  [INFO] Searching repository for plugin with prefix: 'archetype'.
  ...
  [INFO] [archetype:generate]
  [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: local -> cocoon-22-archetype-block-plain (Creates an empty Cocoon 
block)
  2: local -> cocoon-22-archetype-block (Creates a minimal Cocoon block)
  3: local -> cocoon-22-archetype-webapp (Creates a web application 
Cocoon block)
  Choose a number:  (1/2/3): Choose archetype:

There is a caveat though.  I noticed on the Maven bug list [3] that some 
earlier versions of the plugin didn't handle local or remote catalog 
files.  However this seems to have been fixed in the 2.0 alpha-3 version.

So if someone would place this file on the site and update the 
documentation page we should be good to go.  I registered on the Cocoon 
documentation site [2] to see if I could update the pages myself but 
quickly discovered this doesn't let me actually create or edit the 
documentation :-(

Of course this file will have to be updated from time to time.

I have a feeling that Reinhard Pötz is our man for this ;-)  He authored 
the Maven archetype plugin list [2].  This page isn't easy to find so 
there should at least be a link to it from the tutorial pages.

Regards,
David Legg

[1] http://cocoon.zones.apache.org/daisy/
[2] http://cocoon.apache.org/2.2/maven-plugins/
[3] http://jira.codehaus.org/browse/ARCHETYPE-124

Re: Tutorial improvement suggestion

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
David Legg pisze:
> Grek,
> 
>>> The section titled "Creating a block" gives a maven command which 
>>> uses the deprecated goal "archetype:create" instead of 
>>> "archetype:generate"
>>
>> 1. Let's switch to interactive mode and provide archetype catalog...
>> 2. Give up interactive mode completely and stick to utterly long 
>> command...
>>
>> The question is which one we prefer? What do you, dear users, think 
>> about it?
> 
> I think I prefer option 1 as well.
> 
> I don't mind the interactivity as it helps beginners get it right first 
> time... especially if you give clear instructions in the tutorial about 
> what to answer at each prompt and what the answers mean.  The Maven 
> manual page for this plugin [1] is more like I would expect to see in 
> the tutorial (although I'd definitely want the responses highlighted 
> though).

I have the same preference.

The only missing thing is the actual archetype catalog XML file. David, would you like to prepare 
own? I'm not sure how archetype plug-in supports this file generation but even if support is bad you 
could always prepare the catalog by hand (fortunately enough, the list is not long for us).

Are you going to take care of it?

> I can't believe that Maven attempts to list *every* archetype.  That 
> list is going to get awfully long, very quickly.

I think it's due to fact that this plug-in is still in alpha stage and this list is more like a 
proof of concept.

Even if they are going to list all possible archetypes found in central repository I guess that 
particular projects will choose own, focused catalogs that are by far more user friendly.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tutorial improvement suggestion

Posted by David Legg <da...@searchevent.co.uk>.
Grek,

>> The section titled "Creating a block" gives a maven command which 
>> uses the deprecated goal "archetype:create" instead of 
>> "archetype:generate"
>
> 1. Let's switch to interactive mode and provide archetype catalog...
> 2. Give up interactive mode completely and stick to utterly long 
> command...
>
> The question is which one we prefer? What do you, dear users, think 
> about it?

I think I prefer option 1 as well.

I don't mind the interactivity as it helps beginners get it right first 
time... especially if you give clear instructions in the tutorial about 
what to answer at each prompt and what the answers mean.  The Maven 
manual page for this plugin [1] is more like I would expect to see in 
the tutorial (although I'd definitely want the responses highlighted 
though).

I can't believe that Maven attempts to list *every* archetype.  That 
list is going to get awfully long, very quickly.

Regards,
David Legg

[1] http://maven.apache.org/plugins/maven-archetype-plugin/usage.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tutorial improvement suggestion

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
David Legg pisze:
> Just thought I'd mention a tiny improvement that could be made to the 
> "Your first Cocoon application using Maven 2" [1] web page.
> 
> The section titled "Creating a block" gives a maven command which uses 
> the deprecated goal "archetype:create" instead of "archetype:generate" 
> leading to the following disconcerting message during the build: -
> 
>  [INFO] [archetype:create]
>  [WARNING] This goal is deprecated. Please use mvn archetype:generate 
> instead
> 
> If I use archetype:generate instead then Maven interactively asks me 
> some questions I have to guess the answers to ;-)

David, thanks for reporting this problem.

Anyway, it's more Maven to be blamed here that has released alpha version of Archetype 2.0 plug-in 
that is picked up automatically by Maven now.

The tutorial was written at the time when there was no 2.0 version and the instructions worked just 
fine. The are two possible solutions to this situation:
1. Let's switch to interactive mode and provide archetype catalog just like for example MyFaces 
provides[1]. This would result in following work-flow:

   mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org/2.2/archetype-catalog.xml

Then Maven would ask you only which exactly archetype you want to choose and interactively ask for 
basic info like group/artifact id.

2. Give up interactive mode completely and stick to utterly long command by attaching another 
property: -Darchetype.interactive=false and making it even longer:
mvn archetype:create -Darchetype.interactive=false -DarchetypeGroupId=org.apache.cocoon 
-DarchetypeArtifactId=cocoon-22-archetype-block -DarchetypeVersion=1.0.0 -DgroupId=com.mycompany 
-DartifactId=myBlock

The question is which one we prefer? What do you, dear users, think about it?

Personally, I prefer first option because three lines long command is far from being user-friendly.

[1] http://myfaces.apache.org/archetype-catalog.xml

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org