Archetypes
From Lift
Archetypes are templates for new project.
So you could create a new lift app without need to checkout lift from svn, build lift,...
Read the following section and choose your preferred way.
Contents |
Archetypes list
- lift-archetype-blank
- To create a blank/empty liftweb project (nothing to remove)
- groupId: net.liftweb
- last version: 0.9
- repository: http://scala-tools.org/repo-snapshots
- lift-archetype-basic
- To create a liftweb project with ORM,...
- groupId: net.liftweb
- last version: 0.9
- repository: http://scala-tools.org/repo-snapshots
- scala-archetype-simple
- To create a simple scala project (not a webapp or lift project, the template is created with 2 tests, one pass and one fail to allow you check if "test run" works)
- groupId: org.scala-tools.archetypes
- last version: 1.2
- repository: http://scala-tools.org/repo-releases
Result
Result of lift-archetype-blank
your-proj-id/
|-- pom.xml
`-- src
|-- main
| |-- resources
| |-- scala
| | |-- bootstrap
| | | `-- liftweb
| | | `-- Boot.scala
| | `-- your
| | `-- proj
| | `-- gid
| | |-- controller
| | |-- model
| | |-- snippet
| | | `-- HelloWorld.scala
| | `-- view
| `-- webapp
| |-- WEB-INF
| | `-- web.xml
| |-- index.html
| |-- scripts
| | `-- jquery-1.2.1.js
| `-- templates-hidden
| `-- default.html
`-- test
|-- resources
`-- scala
|-- LiftConsole.scala
|-- RunWebApp.scala
`-- your
`-- proj
`-- gid
`-- AppTest.scala
Using archetypes
from Shell (with maven)
To create a new project from an archetype :
- prerequis :
- install maven (>= 2.0.7)
- cd the parent directory where to create your project
- copy/paste one of following command (see the list at the end of this page for description)
- set in last line your groupId and artifactId (
-DgroupId=your.proj.gid -DartifactId=your-proj-id) - [return] to execute
- now you have a project to start working/playing
For a new lift project with nothing extra:
mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-blank \ -DarchetypeVersion=0.9 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=your.proj.gid -DartifactId=your-proj-id
For a new lift project with extras such as a default derby database, User model, basic stylings:
mvn archetype:create -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=0.9 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=your.proj.gid -DartifactId=your-proj-id
mvn archetype:create \ -DarchetypeGroupId=org.scala-tools.archetypes \ -DarchetypeArtifactId=scala-archetype-simple \ -DarchetypeVersion=1.2 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=your.proj.gid -DartifactId=your-proj-id
from Shell (with archy)
Archy is a simple, command-line frontend to Maven 2's Archetypes. It walks you through the process of creating a new project using these project templates.
- prerequis
- install archy
- run archy
java -jar archy.jar
- select or write the name of the archetype (version outdated, wait for the next lift release)
Archetypes are registered into the default List
from Q4E
Q4E is a maven plugin for eclipse (the following list allow to create eclipse project from archetype).
- prerequis :
- install Eclipse
- install Q4E
- Eclipse File > New > Project...
- Select Maven 2 Project>Maven 2 Project Creation Wizard
- Set the name and the location
- Select your archetype
- ... follow wizard
Archetypes are registered into the default List
see Q4E:How to create a new archetype list for more information.

