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!

15 comments:

Anonymous said...

Do you like playing the game where you need to use wow gold, when you do not have World of Warcraft Gold, you must borrow warcraft gold from friends, or you buy wow gold. If you get cheap wow gold, you can continue this game.
Do you like playing the game where you need to use shaiya gold, when you do not have shaiya money, you must borrow cheap shaiya gold from friends, or you could not continue this game without shaiya online gold. If you buy shaiya gold, you can continue this game.

Anonymous said...

I like play online game, I also buy ragnarok online zeny and ro zeny, the ragnarok zeny is very cheap, and use the iro zeny can buy many things, I like cheap zeny, thanks, it is very good.

I like play online game, I also buy rupees and rappelz rupees, the rappelz gold is very cheap, and use the rappelz money can buy many things, I like cheap rappelz rupees, thanks, it is very good.

Adi said...

Find Internet Marketing resource hare Online Marketing Strategy | Internet Marketing Tools | Online Marketing Campaign | Online Marketing Business | Online Marketing System | Online Business | Online Home Business | Online Business Tips | Internet Marketing Online

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]

Daniela said...

Interesting post. I have been wondering about this issue,so thanks for posting. I’ll likely be coming back to your blog. Keep up great writing. Find your great Travel News and sing the songs at Free Song Lyric or you can watch the drama at Korea Drama Online one of great korea drama is A Love to Kill if you go to travel to Indonesia learn Learn Indonesia Language first! And find your home cari rumah or make a blog Belajar membuat Blog find your home again rumah dijual and again at jual rumah then if you want buy a new laptop see the Laptop Price List or you can buy a New Blackberry and then take care your Health & Jewerly.

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!

dfadf said...

Microsoft Office 2010
Office 2010
Office 2007
Microsoft Office
Microsoft Office 2007
Office 2007 key
Office 2007 download
Office 2007 Professional
Windows 7
Microsoft outlook 2010

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.

power2balance said...

power balance
winter boots
Movado Bold
Baby Carriers
ecco shoes
Bakugan Toys
coach outlet store online purses 
Coach Outlet Store
2011 Coach Outlet Store Online
Coach Purses
coach outlet 
Coach Leather Hangbags
Cheap Coach Purses Wholesale 
Cheap Coach Bags Store
Coach Shoulder bags Outlet 
Coach Crossbody leather bags 
Coach Wallets Outlet
Coach Business Bags
Cheap Coach Backpacks 
Coach Sling Bags
Coach Hobos Bags 

afrogshop said...

Thanks so much for the article, quite effective information.

Anonymous said...

cheap alprazolam xanax 2mg fake - xanax and weight gain