Friday, September 14, 2007

Application template generation with "Archetypes" program (Scriptlandia, Maven2, Beanshell)

Maven 2 has the notion of archetype. It is a template of a project which is combined with some user input to produce a working Maven project that has been tailored to the user's requirements.

Some other projects are trying to achieve same goal by using similar or slightly different approaches:

- AppFuse 1.x; (light) - uses Ant scripts to generate template;

- AppFuse 2.x; - uses Maven2 scripts to generate template;

- Able Project (https://svn.opensymphony.com/svn/sandbox/able);

- HSE (Hibernate, Spring, Echo2) Project;

- Archy project.

Archetypes program is based on my previous scripts (see my
previous post) and also inspired by Archy project.

All definitions of archetypes and repository locations are decoupled from source code into external xml file (archetypes.xml).

All archetypes are divided by groups. Group is the list or archetypes that has
same groupId, version (e.g. AppFuse, Maven2 or WebTidy groups).

Each archetype has name, description and version (if different from group version). All archetypes from same group are located in same repository. For example AppFuse fragment looks like:


<groups>
  ...

  <group name="Appfuse" groupId="org.appfuse" prefix="appfuse-" version="2.0-m5" >
    <archetypes>
      <archetype name="basic-jsf"
            description="Archetype for creating a web application with Hibernate, Spring and JSF"/>

      <archetype name="basic-spring"
            description="Archetype for creating a web application with Hibernate, Spring and Spring MVC"/>
      ...
    </archetypes>

    <repositories>
      <repository>http://static.appfuse.org/repository</repository>
    </repositories>
  </group>
  ...
</groups>


In order to run the application you have ho have Scriptlandia
project installed on your computer. It will take care of downloading all required dependencies, installing them locally on your computer and then executing Beanshell script. Otherwise, you have to be ready to do this manually.

Program can function in 2 modes: console and gui. For console mode you have to execute the following command:


>create-archetype.bsh -console


Program will ask the user about archetype group name and archetype name. Then, for your application, you have to specify groupId, artifactId and version. For these parameters Archetypes program will generate the resulting template in current directory.

For "gui" mode you have to execute the following command:


>create-archetype.bsh -wait


"wait" parameter is used my Scriptlandia framework to indicate that our script should wait for completion of gui/swing thread execution. Otherwise, frame will appear for very short time and just after that script execution will be terminated.

In "gui" mode you will see same input parameters, just layed out in more convenient for typical Windows user. After selecting appropriate archetype and clicking on "Create archetype" button, new project will be created in the current directory.

This program uses behind the scene
Scriptlandia API to execute maven2 tool:


ScriptlandiaHelper.executeMaven(args);


The source for this script is located here or within examples for Scriptlandia.

Hope tis program will save you time for your family and friends!

9 comments:

Anonymous said...

Bonjorno, scriptlandia.blogspot.com!
[url=http://cialistagh.pun.pl/ ]Comprare cialis [/url] [url=http://viagraenat.pun.pl/ ]Acquistare viagra generico[/url] [url=http://cialisdkee.pun.pl/ ]Compra cialis online[/url] [url=http://viagraycla.pun.pl/ ]Acquisto viagra online[/url] [url=http://cialisonya.pun.pl/ ]Acquisto cialis [/url] [url=http://viagrareta.pun.pl/ ]Compra viagra in Italia[/url]

Anonymous said...

[url=http://firgonbares.net/][img]http://firgonbares.net/img-add/euro2.jpg[/img][/url]
[b]software cd purchase, [url=http://firgonbares.net/]software no purchase[/url]
[url=http://firgonbares.net/][/url] Mac Logic Express adobe photoshop to buy
coreldraw x4 serial [url=http://firgonbares.net/]buy softwares online[/url] adobe acrobat 9 key
[url=http://firgonbares.net/]adobe conference software[/url] microsoft office software for sale
[url=http://firgonbares.net/]windows vista visual styles[/url] adobe photoshop cs4 full
discount software house legit [url=http://firgonbares.net/]where to buy photoshop in[/b]

Anonymous said...

[url=http://sunkomutors.net/][img]http://sunkomutors.net/img-add/euro2.jpg[/img][/url]
[b]6 month trial of kaspersky, [url=http://sunkomutors.net/]shop software 5.6[/url]
[url=http://sunkomutors.net/][/url] software at academic become software reseller
buy outdated software [url=http://sunkomutors.net/]macromedia software manager[/url] windows xp drivers
[url=http://sunkomutors.net/]office software training[/url] coreldraw graphics suite x4 keygens
[url=http://sunkomutors.net/]torrents adobe photoshop cs4[/url] software discounts uk
windows vista business [url=http://sunkomutors.net/]educational software stores[/b]

Anonymous said...

[url=http://vonmertoes.net/][img]http://bariossetos.net/img-add/euro2.jpg[/img][/url]
[b]ACDSee Pro, [url=http://bariossetos.net/]trading software price[/url]
[url=http://bariossetos.net/][/url] office 2003 sp3 download selling free software
office software packages [url=http://hopresovees.net/]free software of adobe photoshop[/url] burn a vcd movie with nero
[url=http://bariossetos.net/]educational software training[/url] windows vista themes
[url=http://vonmertoes.net/]adobe software[/url] store integration software
adobe software students [url=http://hopresovees.net/]shop 2 software[/b]

Anonymous said...

[url=http://murudobaros.net/][img]http://murudobaros.net/img-add/euro2.jpg[/img][/url]
[b]to buy software that, [url=http://murudobaros.net/]Mac FileMaker Server 10[/url]
[url=http://murudobaros.net/]selling softwares[/url] oem software problems adobe photoshop cs3 class
adobe acrobat 9 trial [url=http://murudobaros.net/]discounted microsoft office[/url] cheap microsoft office home and
[url=http://murudobaros.net/]quarkxpress 5[/url] buy wiki software
[url=http://murudobaros.net/]antivirus software price comparison[/url] windows xp activation
office 2003 activation bypass [url=http://murudobaros.net/]nero 9 software[/b]

Anonymous said...

Can anyone recommend the well-priced Network Management utility for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central software distribution
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

To be a good lenient being is to procure a amiable of openness to the world, an gift to group aleatory things beyond your own manage, that can take you to be shattered in very extreme circumstances for which you were not to blame. That says something uncommonly outstanding with the prerequisite of the principled life: that it is based on a corporation in the up in the air and on a willingness to be exposed; it's based on being more like a shop than like a jewel, something fairly fragile, but whose mere item attraction is inseparable from that fragility.

afrogshop said...

Thanks so much for the article, quite effective information.

Anonymous said...

cheap alprazolam xanax 2mg fake - xanax and weight gain