JS RIA Archetype

The JS Rich Internet Application (RIA) Archetype provides a skeleton project for JavaScript Rich Internet Application development using the JavaScript Maven Plugin and the rich set of Maven-based tools it provides.

A project created with this archetype gives you a working 'Hello World' application which is a starting point for your own JS RIA.

Using the Archetype

Run the following command to create a project using this archetype:

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=javascript-ria-archetype

Maven will then prompt you for details on the project it's about to create - for example:

Define value for property 'groupId': : my.group
Define value for property 'artifactId': : my-jsria
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  my.group: :

Once maven is finished, a new folder will have been created in your working directory which contains a new project based on the settings you provided setup according to the archetype.

What next?

You may want to try the following commands:

mvn test
  • This will launch js-testrunner to run the JavaScript unit tests. You'll need phantomjs installed and on your path for this, see the js-testrunner project for more information on how to configure it.
mvn jetty:run
  • This will launch the jetty container and make the project available to you on a web browser; just visit http://localhost:8080.
mvn site
  • This will generate the site documentation. Open the file (from within your project directory) target/site/index.html to see the web site including JSDoc JavaScript API documentation, which you can find under the 'Project Reports' menu item.
mvn package
  • This will package your project ready for deployment, including concatenated and minified JavaScript resources.

Other Notes:

  • JSLint is automatically invoked; if you have JSLint errors you won't be able to build the project until you rectify them.
  • JavaScript dependency management is provided via AMD support and js-import support.

For more information on the features available in the archetype project, see the javascript maven plugin project - this plugin is what provides the JavaScript tooling for you.

You can learn more about the architecture of the sample project by reading the JSRIA Architecture page.