Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One you have Maven installed, execute the command (copy and paste it as-is)

Footnote

If you prefer, just mvn archetype:generate -DarchetypeRepository=http://tapestry.apache.orgImage Added archetype:generate will wortk as well, and you will be prompted for the other details interactively.

:

No Format
mvn -DarchetypeVersion=5.12.0.54 -Darchetype.interactive=false -DgroupId=com.example -DarchetypeArtifactId=quickstart -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.tapestry -Dpackage=com.example.newapp -DartifactId=newapp --batch-mode -DarchetypeRepository=http://tapestry.apache.org archetype:generate

Maven will (after performing a large number of one-time downloads) create a skeleton project ready to run.

No Format
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Nov 29 18:30:20 CET 2010
[INFO] Final Memory: 20M/213M
[INFO] ------------------------------------------------------------------------
/tmp
$

Because we specified an artifactId of "newapp", the project is created in the newapp directory.

To run the skeleton application, change to the newapp directory and execute:Once it is created, inside the newapp directory maven created for you, you can run

No Format
mvn jetty:run

and after After some more one-time downloads you can open your browser to http://localhost:8080 to see the application running.

...

Tapestry page templates have the .tml extension and are found in src/main/webapp. They Templates are basically essential HTML with some special markup to link the template to the Java class and to reference ready-made components you can use to speed up your development.

Java classes are found in src/main/java/com/example/newapp/pages

Footnote

That is, in the com.example.newapp.pages package.

and their name matches their template name (Index.tml -> Index.java).

In the test project, most of the HTML is not found on the pages themselves but in a Layout component which acts as a global template for the whole site. Java classes for components live in src/main/java/com/example/newapp/components and component templates go in src/main/resources/com/example/newapp/components

...