Child pages
  • Tuscany Maven Archetypes
Skip to end of metadata
Go to start of metadata

Tuscany Maven Archetypes

Tuscany provides some Maven archetypes to make it easy to get going using Tuscany. Maven archetypes provide a simple way to create a project thats configured with exactly what you need to develop your application. You don't need to download, install, or pre-configure Tuscany or your environment, thats all done for you automatically, all you need pre-installed is Maven and Java.

To give it a try run the following command:

That will list out the available archetypes and ask you to choose which one you want:

You are then prompted to answer several questions about the project such as the Maven group and artifact IDs, Java package names etc. Some of those will show default values before the prompt so you can just hit enter to take the default. Thats it, and then the Maven project is created in a folder in the current directory named after the artifactid you entered.

The following shows the console session for creating an SCA contribution JAR:

That will create a Maven project in a folder named scatest with the following directory structure and files:

When using one of the archetypes which create webapp projects the pom.xml is configured with the maven Jetty plugin so you can run the webapp right away without needing to install the WAR file into an appserver by using the command "mvn jetty:run". The following shows an examaple of this using the tuscany-quickstart archetype:

The webapp runs at the context path of the artifact name on port 8080 so on a web browser go to http://localhost:8080/mytest/ and you should see a page showing:

Calling HelloworldService sayHello("world") returns:
Hello world

  • No labels