summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html
diff options
context:
space:
mode:
Diffstat (limited to 'site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html')
-rw-r--r--site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html243
1 files changed, 243 insertions, 0 deletions
diff --git a/site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html b/site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html
new file mode 100644
index 0000000000..ae0f54d03a
--- /dev/null
+++ b/site/trunk/site-publish/documentation-2x/tuscany-maven-archetypes.html
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+ <HEAD>
+ <META name="description" content="Apache Tuscany">
+ <META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture, sca, service component architecture, das, sdo, csa, ruby, opensource">
+
+ <LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
+ <LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/$images/favicon.ico">
+ <TITLE>Tuscany Maven Archetypes : Apache Tuscany</TITLE>
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
+
+ <STYLE>
+ .spacetree * ul {
+ padding-left:0px;
+ margin-left: 0px;
+ }
+ .spacetree * li {
+ margin-left: 5px;
+ padding-left:5px;
+ }
+ </STYLE>
+
+ <BODY onload="init()">
+ <!-- topNav -->
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" align="left" nowrap="">
+ <A href="https://cwiki.apache.org/geronimo"> Home</A> &gt;&nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="" title="Tuscany Maven Archetypes">Tuscany Maven Archetypes</A>
+ </TD>
+ <TD align="right" valign="middle" nowrap="">
+ <FORM name="search" action="http://www.google.com/search" method="get">
+ <INPUT type="hidden" name="ie" value="UTF-8">
+ <INPUT type="hidden" name="oe" value="UTF-8">
+ <INPUT type="hidden" name="domains" value="">
+ <INPUT type="hidden" name="sitesearch" value="">
+ <INPUT type="text" name="q" maxlength="255" value="">
+ <INPUT type="submit" name="btnG" value="Google Search">
+ </FORM>
+ </TD>
+ </TR>
+ </TABLE>
+
+
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
+ &nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="" title="Tuscany Maven Archetypes">Tuscany Maven Archetypes</A>
+ </TD>
+
+ <TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
+ <A href="http://tuscany.apache.org/">Tuscany Home</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+
+ <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
+ <TR>
+ <TD valign="top" align="left" width="22%" bgcolor="#F9F9F9" class="noprint">
+ <DIV class="tabletitle">Table of Contents</DIV>
+ <DIV class="spacetree">
+
+
+ </DIV>
+ </TD>
+ <TD align="left" valign="top" width="78%">
+ <!-- pageContent -->
+ <DIV id="PageContent">
+ <DIV class="pageheader" style="padding: 6px 0px 0px 0px;">
+ <!-- We'll enable this once we figure out how to access (and save) the logo resource -->
+ <!--img src="http://geronimo.apache.org/images/confluence_logo.gif" style="float: left; margin: 4px 4px 4px 10px;" border="0"-->
+ <DIV style="margin: 0px 10px 0px 10px" class="smalltext">Apache Tuscany Docs 2.x</DIV>
+ <DIV style="margin: 0px 10px 8px 10px" class="pagetitle">Tuscany Maven Archetypes</DIV>
+
+ <DIV class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+<!-- -->
+ <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=2329557">
+ <IMG src="http://geronimo.apache.org/images/icons/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=2329557">Edit Page</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">
+ <IMG src="http://geronimo.apache.org/images/icons/browse_space.gif" height="16" width="16" border="0" align="absmiddle" title="Browse Space"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">Browse Space</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=2329557">
+ <IMG src="http://geronimo.apache.org/images/icons/add_page_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add Page"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=2329557">Add Page</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=2329557">
+ <IMG src="http://geronimo.apache.org/images/icons/add_blogentry_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add News"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=2329557">Add News</A>
+<!-- -->
+ </DIV>
+ </DIV>
+
+ <DIV class="pagecontent">
+ <DIV class="wiki-content">
+
+<H1><A name="TuscanyMavenArchetypes-TuscanyMavenArchetypes"></A>Tuscany Maven Archetypes</H1>
+
+<P>Tuscany provides some <A href="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html" class="external-link" rel="nofollow">Maven archetypes </A> 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.</P>
+
+<P>To give it a try run the following command:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+mvn archetype:generate -DarchetypeCatalog=http:<SPAN class="code-comment">//tuscany.apache.org</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>That will list out the available archetypes and ask you to choose which one you want:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+Choose archetype:
+1: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-contribution-jar (Create an SCA contribution JAR)
+</SPAN>2: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart (Create a Tuscany SCA and JSP project)
+</SPAN>3: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart-stripes (Create a Tuscany SCA and Stripes Web Framework project)
+</SPAN>4: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart-jsf (Create a Tuscany SCA and JSF project)
+</SPAN>Choose a number: (1/2/3/4):
+</PRE>
+</DIV></DIV>
+
+<P>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.</P>
+
+<P>The following shows the console session for creating an SCA contribution JAR:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+Choose a number: (1/2/3/4): 4
+Define value <SPAN class="code-keyword">for</SPAN> groupId: : org.myco.sca.test
+Define value <SPAN class="code-keyword">for</SPAN> artifactId: : scatest
+Define value <SPAN class="code-keyword">for</SPAN> version: 1.0-SNAPSHOT: :
+Define value <SPAN class="code-keyword">for</SPAN> <SPAN class="code-keyword">package</SPAN>: org.myco.sca.test: :
+Confirm properties configuration:
+groupId: org.myco.sca.test
+artifactId: scatest
+version: 1.0-SNAPSHOT
+<SPAN class="code-keyword">package</SPAN>: org.myco.sca.test
+ Y: :
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1 minute 15 seconds
+[INFO] Finished at: Tue Mar 31 15:08:45 BST 2009
+[INFO] Final Memory: 8M/14M
+[INFO] ------------------------------------------------------------------------
+</PRE>
+</DIV></DIV>
+
+<P>That will create a Maven project in a folder named scatest with the following directory structure and files:</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+scatest\pom.xml
+scatest\src\main\java\org\myco\sca\test\HelloworldImpl.java
+scatest\src\main\java\org\myco\sca\test\HelloworldService.java
+scatest\src\main\resources\helloworld.composite
+scatest\src\main\resources\META-INF\sca-contribution.xml
+</PRE>
+</DIV></DIV>
+
+<P>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 &quot;mvn jetty:run&quot;. The following shows an examaple of this using the tuscany-quickstart archetype:</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&gt; mvn archetype:generate -DarchetypeCatalog=http:<SPAN class="code-comment">//tuscany.apache.org
+</SPAN>[INFO] Scanning <SPAN class="code-keyword">for</SPAN> projects...
+. . .
+Choose archetype:
+1: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-contribution-jar (Create an SCA JAR contribution project)
+</SPAN>2: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-contribution-zip (Create an SCA ZIP contribution project)
+</SPAN>3: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart (Create a simple SCA webapp project)
+</SPAN>4: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart-jsf (Create a Webapp using SCA and JSF)
+</SPAN>5: http:<SPAN class="code-comment">//tuscany.apache.org -&gt; tuscany-quickstart-stripes (Create a Webapp using SCA and the Stripes Web Framework)
+</SPAN>Choose a number: (1/2/3/4/5): 3
+Define value <SPAN class="code-keyword">for</SPAN> groupId: : mygroup
+Define value <SPAN class="code-keyword">for</SPAN> artifactId: : mytest
+Define value <SPAN class="code-keyword">for</SPAN> version: 1.0-SNAPSHOT: :
+Define value <SPAN class="code-keyword">for</SPAN> <SPAN class="code-keyword">package</SPAN>: mygroup: :
+Confirm properties configuration:
+groupId: mygroup
+artifactId: mytest
+version: 1.0-SNAPSHOT
+<SPAN class="code-keyword">package</SPAN>: mygroup
+ Y: :
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+
+&gt; cd mytest
+&gt; mvn jetty:run
+. . .
+[INFO] Started Jetty Server
+</PRE>
+</DIV></DIV>
+
+<P>The webapp runs at the context path of the artifact name on port 8080 so on a web browser go to <A href="http://localhost:8080/mytest/" class="external-link" rel="nofollow">http://localhost:8080/mytest/</A> and you should see a page showing:</P>
+
+<P>Calling HelloworldService sayHello(&quot;world&quot;) returns:<BR>
+Hello world </P>
+
+ </DIV>
+
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+
+ <!-- footer -->
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR>
+ <TD align="left" valign="middle" class="footer">
+ &nbsp;&nbsp;
+ <IMG src="http://static.delicious.com/img/delicious.small.gif" height="10" width="10" alt="Delicious">
+ <A href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=550,height=550'); return false;">Bookmark this on Delicious</A>
+ &nbsp;&nbsp;
+ <IMG src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" alt="Digg!">
+ <A href="" onclick="window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&topic=programming');">Digg this</A>
+ <!-- Slicker, but no text
+ <script type="text/javascript">
+ digg_skin = 'icon';
+ digg_window = 'new';
+ digg_title = 'Apache Geronimo v2.2 Documentation : Tuscany Maven Archetypes';
+ digg_topic = 'programming';
+ </script>
+ <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
+ -->
+ &nbsp;&nbsp;
+ </TD>
+ <TD align="right" valign="middle" class="footer">
+ <A href="http://cwiki.apache.org/GMOxPMGT/geronimo-privacy-policy.html">Privacy Policy</A>&nbsp;&nbsp;-&nbsp;&nbsp;
+ Copyright &copy; 2003-2010, The Apache Software Foundation, Licensed under <A href="http://www.apache.org/licenses/LICENSE-2.0">ASL 2.0.</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+
+ </BODY>
+</HTML> \ No newline at end of file