You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2009/02/27 14:21:10 UTC

Tuscany maven archetypes

How about we create some Maven archetypes to help users getting started with
projects using Tuscany? Maven archetypes can generate customized ready to
build projects so you don't need to download or install or manually setup
dependencies or anything (see [1] for more info).

To show what thats like I've created a very simple one at
archetypes/quickstart which creates a simple SCA webapp project. To try it
you need to build the archetypes/quickstart module (if we'd released it to
the public maven repository you wouldn't need to build it), and then from an
empty folder run this command:

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
-DarchetypeGroupId=org.apache.tuscany.sca
-DarchetypeArtifactId=tuscany-archetype-quickstart
-DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
-DartifactId=myproject

That creates a new SCA project, building it with mvn should create a ready
to use war file. The command is a bit of a mouthful as its currently using
an old version of the archetype plugin.

It looks like it has potential to me, we could create variations on that for
the different Tuscany environments and extensions, or perhaps even customize
the plugin so you can specify the extensions you want to include in the
project on the command line. What do you think, worth exploring, interested
in helping?

   ...ant

[1]
http://maven.apache.org/guides/introduction/introduction-to-archetypes.html

Re: Tuscany maven archetypes

Posted by Raymond Feng <en...@gmail.com>.
+1. It might be able to complement Idea 1 on the GSoC 2009 list.

[1] http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Google+Summer+of+Code+2009

Thanks,
Raymond


From: Simon Laws 
Sent: Friday, February 27, 2009 8:36 AM
To: dev@tuscany.apache.org ; antelder@apache.org 
Subject: Re: Tuscany maven archetypes





On Fri, Feb 27, 2009 at 3:40 PM, ant elder <an...@gmail.com> wrote:




  On Fri, Feb 27, 2009 at 1:21 PM, ant elder <an...@gmail.com> wrote:

    How about we create some Maven archetypes to help users getting started with projects using Tuscany? Maven archetypes can generate customized ready to build projects so you don't need to download or install or manually setup dependencies or anything (see [1] for more info).

    To show what thats like I've created a very simple one at archetypes/quickstart which creates a simple SCA webapp project. To try it you need to build the archetypes/quickstart module (if we'd released it to the public maven repository you wouldn't need to build it), and then from an empty folder run this command:

    mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U -DarchetypeGroupId=org.apache.tuscany.sca -DarchetypeArtifactId=tuscany-archetype-quickstart -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject

    That creates a new SCA project, building it with mvn should create a ready to use war file. The command is a bit of a mouthful as its currently using an old version of the archetype plugin. 

    It looks like it has potential to me, we could create variations on that for the different Tuscany environments and extensions, or perhaps even customize the plugin so you can specify the extensions you want to include in the project on the command line. What do you think, worth exploring, interested in helping? 

       ...ant

    [1] http://maven.apache.org/guides/introduction/introduction-to-archetypes.html



  Having read a bit more about these you can specify the repository with a property so you don't need to build it first you can just use the command:

  mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U -DarchetypeGroupId=org.apache.tuscany.sca -DarchetypeArtifactId=tuscany-archetype-quickstart -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository/

     ...ant




+1. I don't see a downside. Could be another GSoC project in terms of extending the possibilities. 

What others would be useful in the first instance

jse launcher based project?
osgi launcher based project?

We'd need test/distribution support to test them. 

Simon

Re: Tuscany maven archetypes

Posted by Simon Laws <si...@googlemail.com>.
On Mon, Mar 2, 2009 at 10:54 AM, ant elder <an...@apache.org> wrote:

>
>
> On Fri, Feb 27, 2009 at 4:36 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> >
> > We'd need test/distribution support to test them.
> >
>
> So I guess to do that as part of an itest it needs to run the maven
> archetype plugin to create a new project in the target folder, then build
> that new project, deploy the jar/war to a runtime and run some tests. I'm
> not sure exactly how to do that (as part of the build create a new maven
> project and then build that project) so before i start looking does anyone
> have any ideas on how to do that itesting?
>
>   ...ant
>

I don't know either but I'd start by dropping out of maven if possible, e.g.
drop out to an ant script. The first question is can you do

mvn -> ant -> mvn

without any problems. I guess we could just exec the second mvn command.

Simon

Re: Tuscany maven archetypes

Posted by ant elder <an...@apache.org>.
On Fri, Feb 27, 2009 at 4:36 PM, Simon Laws <si...@googlemail.com>
wrote:

>
> We'd need test/distribution support to test them.
>

So I guess to do that as part of an itest it needs to run the maven
archetype plugin to create a new project in the target folder, then build
that new project, deploy the jar/war to a runtime and run some tests. I'm
not sure exactly how to do that (as part of the build create a new maven
project and then build that project) so before i start looking does anyone
have any ideas on how to do that itesting?

  ...ant

Re: Tuscany maven archetypes

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Feb 27, 2009 at 3:40 PM, ant elder <an...@gmail.com> wrote:

>
>
> On Fri, Feb 27, 2009 at 1:21 PM, ant elder <an...@gmail.com> wrote:
>
>> How about we create some Maven archetypes to help users getting started
>> with projects using Tuscany? Maven archetypes can generate customized ready
>> to build projects so you don't need to download or install or manually setup
>> dependencies or anything (see [1] for more info).
>>
>> To show what thats like I've created a very simple one at
>> archetypes/quickstart which creates a simple SCA webapp project. To try it
>> you need to build the archetypes/quickstart module (if we'd released it to
>> the public maven repository you wouldn't need to build it), and then from an
>> empty folder run this command:
>>
>> mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
>> -DarchetypeGroupId=org.apache.tuscany.sca
>> -DarchetypeArtifactId=tuscany-archetype-quickstart
>> -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
>> -DartifactId=myproject
>>
>> That creates a new SCA project, building it with mvn should create a ready
>> to use war file. The command is a bit of a mouthful as its currently using
>> an old version of the archetype plugin.
>>
>> It looks like it has potential to me, we could create variations on that
>> for the different Tuscany environments and extensions, or perhaps even
>> customize the plugin so you can specify the extensions you want to include
>> in the project on the command line. What do you think, worth exploring,
>> interested in helping?
>>
>>    ...ant
>>
>> [1]
>> http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
>>
>
> Having read a bit more about these you can specify the repository with a
> property so you don't need to build it first you can just use the command:
>
> mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
> -DarchetypeGroupId=org.apache.tuscany.sca
> -DarchetypeArtifactId=tuscany-archetype-quickstart
> -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
> -DartifactId=myproject -DremoteRepositories=
> http://people.apache.org/repo/m2-snapshot-repository/
>
>    ...ant
>
>
>
+1. I don't see a downside. Could be another GSoC project in terms of
extending the possibilities.

What others would be useful in the first instance

jse launcher based project?
osgi launcher based project?

We'd need test/distribution support to test them.

Simon

Re: Tuscany maven archetypes

Posted by ant elder <an...@gmail.com>.
On Fri, Feb 27, 2009 at 1:21 PM, ant elder <an...@gmail.com> wrote:

> How about we create some Maven archetypes to help users getting started
> with projects using Tuscany? Maven archetypes can generate customized ready
> to build projects so you don't need to download or install or manually setup
> dependencies or anything (see [1] for more info).
>
> To show what thats like I've created a very simple one at
> archetypes/quickstart which creates a simple SCA webapp project. To try it
> you need to build the archetypes/quickstart module (if we'd released it to
> the public maven repository you wouldn't need to build it), and then from an
> empty folder run this command:
>
> mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
> -DarchetypeGroupId=org.apache.tuscany.sca
> -DarchetypeArtifactId=tuscany-archetype-quickstart
> -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
> -DartifactId=myproject
>
> That creates a new SCA project, building it with mvn should create a ready
> to use war file. The command is a bit of a mouthful as its currently using
> an old version of the archetype plugin.
>
> It looks like it has potential to me, we could create variations on that
> for the different Tuscany environments and extensions, or perhaps even
> customize the plugin so you can specify the extensions you want to include
> in the project on the command line. What do you think, worth exploring,
> interested in helping?
>
>    ...ant
>
> [1]
> http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
>

Having read a bit more about these you can specify the repository with a
property so you don't need to build it first you can just use the command:

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
-DarchetypeGroupId=org.apache.tuscany.sca
-DarchetypeArtifactId=tuscany-archetype-quickstart
-DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
-DartifactId=myproject -DremoteRepositories=
http://people.apache.org/repo/m2-snapshot-repository/

   ...ant

Re: Tuscany maven archetypes

Posted by ant elder <an...@gmail.com>.
On Sat, Feb 28, 2009 at 9:14 AM, ant elder <an...@gmail.com> wrote:

>
>
> On Fri, Feb 27, 2009 at 2:17 PM, Dan Becker <da...@gmail.com>wrote:
>
>
>  The command looks a bit large, but with cut and paste or some sort of link
>> from a page, it should be easy for a new user to operate.
>>
>
> I've done some updates to use the newer archetype style so now you can use
> "mvn archetype:generate" which is a bit more concise, and I've added an
> archetype catalog to the Tuscany website so you can point at that and get
> interactive prompting to choose the archetype and configure the new project.
> Right now you still need to specify the ASF snapshot repository but once
> we've done a release that includes the archetypes that wont be required.
>
> So now you can do:
>
> mvn archetype:generate -DarchetypeCatalog=
> http://tuscany.apache.org/archetypes -DarchetypeRepository=
> http://people.apache.org/repo/m2-snapshot-repository
>
> that then prompts you for the archetype (we've only the one so far), the
> groupid, artifactid and package names to use, and it creates the new project
> in a folder named after the artifactid. (go on try it, you don't need to
> install or download anything just paste that command into a command prompt)
>
> That generated project also has the Maven Jetty plugin configured so you
> don't need to deploy the war to Tomcat to run the sample you can just use
> "mvn jetty:run"
>
> This is looking really useful and user friendly to me. How about we set up
> archetypes for all the high level scenarios we have in Tuscany, and also
> perhaps in the distribution change the samples for those scenarios so that
> they match the projects generated by the archetypes.
>
>    ...ant
>

One more FYI update on this, I've added a couple more archetypes, one
showing JSF using SCA  and another with the Stripes Web Framework and SCA
(feel free anyone to dive in and add some more). Also moved the catalog to
the top of the Tuscany site instead of a sub folder so its a bit less to
type, still need to define the snapshot repo till we release them so that
makes the current command:

mvn archetype:generate
-DarchetypeCatalog=http://tuscany.apache.org-DarchetypeRepository=
http://people.apache.org/repo/m2-snapshot-repository

   ...ant

Re: Tuscany maven archetypes

Posted by ant elder <an...@gmail.com>.
On Fri, Feb 27, 2009 at 2:17 PM, Dan Becker <da...@gmail.com> wrote:


 The command looks a bit large, but with cut and paste or some sort of link
> from a page, it should be easy for a new user to operate.
>

I've done some updates to use the newer archetype style so now you can use
"mvn archetype:generate" which is a bit more concise, and I've added an
archetype catalog to the Tuscany website so you can point at that and get
interactive prompting to choose the archetype and configure the new project.
Right now you still need to specify the ASF snapshot repository but once
we've done a release that includes the archetypes that wont be required.

So now you can do:

mvn archetype:generate -DarchetypeCatalog=
http://tuscany.apache.org/archetypes -DarchetypeRepository=
http://people.apache.org/repo/m2-snapshot-repository

that then prompts you for the archetype (we've only the one so far), the
groupid, artifactid and package names to use, and it creates the new project
in a folder named after the artifactid. (go on try it, you don't need to
install or download anything just paste that command into a command prompt)

That generated project also has the Maven Jetty plugin configured so you
don't need to deploy the war to Tomcat to run the sample you can just use
"mvn jetty:run"

This is looking really useful and user friendly to me. How about we set up
archetypes for all the high level scenarios we have in Tuscany, and also
perhaps in the distribution change the samples for those scenarios so that
they match the projects generated by the archetypes.

   ...ant

Re: Tuscany maven archetypes

Posted by Dan Becker <da...@gmail.com>.
Wow. +1!

I think these archetypes have lots of potential. The command looks a bit 
large, but with cut and paste or some sort of link from a page, it 
should be easy for a new user to operate.

This is very ripe for a desktop demo or video as well.

ant elder wrote:
> How about we create some Maven archetypes to help users getting started with
> projects using Tuscany? Maven archetypes can generate customized ready to
> build projects so you don't need to download or install or manually setup
> dependencies or anything (see [1] for more info).
> 
> To show what thats like I've created a very simple one at
> archetypes/quickstart which creates a simple SCA webapp project. To try it
> you need to build the archetypes/quickstart module (if we'd released it to
> the public maven repository you wouldn't need to build it), and then from an
> empty folder run this command:
> 
> mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -U
> -DarchetypeGroupId=org.apache.tuscany.sca
> -DarchetypeArtifactId=tuscany-archetype-quickstart
> -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=com.mycompany
> -DartifactId=myproject
> 
> That creates a new SCA project, building it with mvn should create a ready
> to use war file. The command is a bit of a mouthful as its currently using
> an old version of the archetype plugin.
> 
> It looks like it has potential to me, we could create variations on that for
> the different Tuscany environments and extensions, or perhaps even customize
> the plugin so you can specify the extensions you want to include in the
> project on the command line. What do you think, worth exploring, interested
> in helping?
> 
>    ...ant
> 
> [1]
> http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
> 


-- 
Thanks, Dan Becker