Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update for 5.4-beta-28

...

Maven will prompt you for the archetype to create ("Tapestry 5 Quickstart Project") and the exact version number ("5.3.74.-beta-28", at the time of writing). It also asks you for a group id, an artifact id, and a version number.

Note

Currently, it is necessary to use a staging URI to get the 5.4 beta archetype. This will change after the final Tapestry 5.4 release.


You can see this in the following transcript:

No Format
$ mvn archetype:generate -DarchetypeCatalog=httphttps://tapestryrepository.apache.org/content/repositories/staging
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.13:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.13:generate (default-cli) @ < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.13:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1...
5: httphttps://tapestryrepository.apache.org/content/repositories/staging -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project)
2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype)-)
...
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 105: 15
Choose org.apache.tapestry:quickstart version:
1: 5.0.193
2: 5.3.1.0.5
3: 5.3.2.6
4: 5.3.7
Choose a number: 4: 4
Downloading: http://tapestry.apache.org/org/apache/tapestry/quickstart/5.3.7/quickstart-3-rc-1
5: 5.3.3
6: 5.3.4
7: 5.3.5
8: 5.3.6
9: 5.3.7.jar
Downloading10: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.7/quickstart-8
11: 5.3.7.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.7/quickstart-5.3.7.jar (64 KB at 69.3 KB/sec)
Downloading: http://tapestry.apache.org/org/apache/tapestry/quickstart/5.3.7/quickstart-5.3.7.pom
Downloading: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.7/quickstart-5.3.7.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/tapestry/quickstart/5.3.7/quickstart-5.3.7.pom (400 B at 1.0 KB/sec)
Define value for property 'groupId': : com.example
Define value for property 'artifactId': : newapp
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.example: : com.example.newapp
Confirm properties configuration:
groupId: com.example
artifactId: newapp
version: 1.0-SNAPSHOT
package: com.example.newapp
 Y: :
[INFO] ----4-beta-3
12: 5.4-beta-6
13: 5.4-beta-22
14: 5.4-beta-26
15: 5.4-beta-27
16: 5.4-beta-28
Choose a number: 16: 16
Define value for property 'groupId': : com.example
Define value for property 'artifactId': : newapp
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.example: : com.example.newapp
Confirm properties configuration:
groupId: com.example
artifactId: newapp
version: 1.0-SNAPSHOT
package: com.example.newapp
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: quickstart:5.4-beta-28
[INFO] -------------------------------------------------------------------------------------
[INFO] UsingParameter: followinggroupId, parameters for creating project from Archetype: quickstart:5.3.7Value: com.example
[INFO] Parameter: artifactId, Value: newapp
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example.newapp
[INFO] Parameter: packageInPathFormat, Value: com./example/newapp
[INFO] Parameter: artifactIdpackage, Value: com.example.newapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: packagegroupId, Value: com.example.newapp
[INFO] Parameter: packageInPathFormatartifactId, Value: com/example/newapp
[INFOWARNING] Parameter: package, Value: com.example.newapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: newapp
[WARNING] Don't override file /Users/hlship/workspaces/githubDon't override file /Users/hlship/workspaces/tapestry/tapestry-doc-examples/newapp/src/test/java
[WARNING] Don't override file /Users/hlship/workspaces/tapestry/tapestry-doc-examples/newapp/src/testmain/javawebapp
[WARNING] Don't override file /Users/hlship/workspaces/github/newapp/src/main/webapp
[WARNING] Don't override file /Users/hlship/workspaces/github/tapestry/tapestry-doc-examples/newapp/src/main/resources/com/example/newapp
[WARNING] Don't override file /Users/hlship/workspaces/githubtapestry/tapestry-doc-examples/newapp/src/test/resources
[WARNING] Don't override file /Users/hlship/workspaces/github/tapestry/tapestry-doc-examples/newapp/src/test/conf
[WARNING] Don't override file /Users/hlship/workspaces/github/tapestry/tapestry-doc-examples/newapp/src/site
[INFO] project created from Archetype in dir: /Users/hlship/workspaces/github/tapestry/tapestry-doc-examples/newapp
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3132.062s094 s
[INFO] Finished at: Fri Mar 1 11:11:14 PST 20132015-04-03T08:10:26-07:00
[INFO] Final Memory: 7M15M/81M216M
[INFO] ------------------------------------------------------------------------
~/workspaces/tapestry/tapestry-doc-examples
$

Maven will (after performing a number of one-time downloads) create a skeleton project ready to run. Because we specified an artifactId of "newapp", the project is created in the newapp directory. (Note: if you get "Unable to get resource" warnings at this stage, you may be behind a firewall which blocks outbound HTTP requests to Maven repositories.)

To run the skeleton application, change to the newapp directory and execute:

No Format
$ mvn jetty:run

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

Image Removed

The application consists of three pages sharing a common look and feel. The initial page, Index, allows you to perform some basic operations.

You can also load the newly-created project it into any IDE and start coding. See the next section on where to find the different components of the application.

Exploring the generated project

The archetype creates the following files:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building newapp Tapestry 5 Application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------

...

Application 'app' (version 1.0-SNAPSHOT-DEV) startup time: 329 ms to build IoC Registry, 919 ms overall.
 ______                  __             ____
/_  __/__ ____  ___ ___ / /_______ __  / __/
 / / / _ `/ _ \/ -_|_-</ __/ __/ // / /__ \
/_/  \_,_/ .__/\__/___/\__/_/  \_, / /____/
        /_/                   /___/  5.4-beta-28 (development mode)

[INFO] Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server

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

Image Added

The application consists of three pages sharing a common look and feel. The initial page, Index, allows you to perform some basic operations.

You can also load the newly-created project it into any IDE and start coding. See the next section on where to find the different components of the application.

Exploring the generated project

The archetype creates the following files:

No Format
newapp/
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── example
    │   │           └── newapp
    │   │               ├── components
    │   │               │   └── Layout.java
    │   │               ├── pages
    │   │               │   ├── About.java
    │   │               │   ├── Contact.java
    │   │               │   ├── Error404.java
    │   │               │   ├── Index.java
    │   │
No Format
newapp
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── example
    │   │           └── newapp
    │   │               ├── components
    │   │   └── Login.java
           │   └── Layout.java
    │   │       └── services
       ├── pages
    │   │               │   ├── AboutAppModule.java
    │   │               │   ├── Contact.java
    │   │        ├── DevelopmentModule.java
      │   └── Index.java
    │   │               └── servicesQaModule.java
    │   │    ├── resources
          ├──  com
  ├── AppModule.java
    │   │       └── example
           ├── DevelopmentModule.java
    │   │   └── newapp
               └── QaModule.java
    │   ├── resourcescomponents
    │   │   ├── com
    │   │   │   └── example
    │   │   │       └── newappLayout.tml
     │   │   │           ├── components
    │   │   │  ├── logback.xml
          │   └── Layout.tml
    │   │   │     └── pages
     └── pages
    │   │   │               ├── About.tml
     │   │   │  │   │   │               ├── Contact.tml
    │   │   │               ├── IndexError404.properties
 tml
    │   │   │   │   │               └──├── Index.tmlproperties
       │   │   └── log4j.properties
    │   └── webapp
    │       ├── WEB-INF
Index.tml
    │    │       │   ├── app.properties
    │       │   └── webLogin.xmltml
     │       ├──└── faviconlog4j.icoproperties
    │       └── layoutwebapp
    │           ├── imagesWEB-INF
    │           │   ├── img01app.jpgproperties
    │           │   ├──└── img03web.jpgxml
    │           │   ├── img04favicon.jpgico
    │           │   ├── img08.gifimages
    │           │   ├──└── img09tapestry.gifpng
      │       └── mybootstrap
   │   ├── img10.gif
    │        ├── css
  │   ├── img11.gif
    │           │   ├── img12bootstrap-responsive.gifcss
      │             │   ├──└── img13bootstrap.gifcss
     │           │   ├── img14.gif
img
    │    │           │   ├── img18.gifglyphicons-halflings-white.png
    │           │   ├── img19.gif
    │    └── glyphicons-halflings.png
      │   └── img20.gif
    │     └── js
     ├── layout.css
    │           └── licensebootstrap.txtjs
    ├── site
      │   ├── apt
    │   │  │   │   └── index.apt
      │   └── site.xml
    └── test
        ├── conf
          │   ├── testng.xml
          │   └── webdefault.xml
        ├── java
          │   └── PLACEHOLDER
        └── resources
            └── PLACEHOLDER
30 directories, 39 files

A Tapestry application is composed of pages, each page consisting of one template file and one Java class.

...