Artifact Content
Not logged in

Artifact a1b462b6ef76ad3d808b3741d868e9e39d6a80ff:

Wiki page [Getting started] by timoteo.ponce 2016-02-07 15:51:00.
D 2016-02-07T15:51:00.306
L Getting\sstarted
P 6ec80a8754239fa11b28821c54d8b035e674c411
U timoteo.ponce
W 4095
<h2>Pre-requisites</h2>

  *  Java version 1.6 or higher
  *  Apache Maven 3
  *  Fossil SCM
  *  Any kind of shell

<h2>Install the archetype</h2>

Automatically, from the shell execute the following commands (assuming Unix-like OS):
<verbatim>
    $> mkdir dci_archetype
    $> fossil clone https://chiselapp.com/user/timoteo.ponce/repository/dci_webapp_archetype dci_archetype.fossil
    $> fossil open dci_archetype.fossil
    $> sh install.sh
</verbatim>

Manually, from the shell execute the following commands (assuming Unix-like OS):
<verbatim>
    $> mkdir dci_archetype
    $> fossil clone https://chiselapp.com/user/timoteo.ponce/repository/dci_webapp_archetype dci_archetype.fossil
    $> fossil open dci_archetype.fossil
    $> cd dci_archetype
    $> mvn clean install
</verbatim>

<h2>Create a new application with the newly installed archetype</h2>

Also from a shell run the following commands:

<verbatim>
    $> mvn archetype:generate
</verbatim>

There you will have a full list of archetypes numbered, select the one with the name <b>dci-webapp</b>:

<verbatim>
    1091: local -> com.github.timoteoponce:dci-webapp (Web application archetype based on DCI concepts)
    Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 436: 1091
</verbatim>

Or you can select the archetype by default:
<verbatim>
    mvn archetype:generate -DarchetypeGroupId=com.github.timoteoponce -DarchetypeArtifactId=dci-webapp
</verbatim>

Then name your packages as you like, in our example it will be called <b>webapp01</b>:
<verbatim>
    Define value for property 'groupId': : org.timoponce
    Define value for property 'artifactId': : webapp01
    Define value for property 'version':  1.0-SNAPSHOT: : 
    Define value for property 'package':  org.timoponce: : 
    Confirm properties configuration:
    groupId: org.timoponce
    artifactId: webapp01
    version: 1.0-SNAPSHOT
    package: org.timoponce
     Y: : y
    [INFO] ----------------------------------------------------------------------------
    [INFO] Using following parameters for creating project from Archetype: dci-webapp:1.0-SNAPSHOT
    [INFO] ----------------------------------------------------------------------------
    [INFO] Parameter: groupId, Value: org.timoponce
    [INFO] Parameter: artifactId, Value: webapp01
    [INFO] Parameter: version, Value: 1.0-SNAPSHOT
    [INFO] Parameter: package, Value: org.timoponce
    [INFO] Parameter: packageInPathFormat, Value: org/timoponce
    [INFO] Parameter: package, Value: org.timoponce
    [INFO] Parameter: version, Value: 1.0-SNAPSHOT
    [INFO] Parameter: groupId, Value: org.timoponce
    [INFO] Parameter: artifactId, Value: webapp01
    [INFO] project created from Archetype in dir: /Users/timoteo/projects/webapp01
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 2:43.200s
    [INFO] Finished at: Thu Jul 03 16:57:39 BOT 2014
    [INFO] Final Memory: 9M/81M
    [INFO] ------------------------------------------------------------------------
    
</verbatim>

The same can be done in a single command:
<verbatim>
    mvn archetype:generate -DgroupId=org.timoponce \
        -DartifactId=webapp01 -DarchetypeArtifactId=dci-webapp \
        -DarchetypeGroupId=com.github.timoteoponce \
        -DinteractiveMode=false
</verbatim>
Now run the application:

<verbatim>
    $> cd webapp01
    $> mvn jetty:run
</verbatim>

And open it on your browser at location <a href="http://localhost:8080">http://localhost:8080<a>

<center>
<img src="/doc/tip/doc/img/demo_app_01.png" height="400"/>
</center>

<h2>Show me the database </h2>

With the following command you will have a web-UI for managing the H2-embedded database:
<verbatim>
    $> mvn exec:java -Ddatabase
</verbatim>
For further details on the newly setup project go to [Example application]
Z ba5880429c2c8996e7e46322a8c8b2e3