incubator-syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Syncope > Create a new Syncope project
Date Wed, 18 Apr 2012 08:10:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/3/_/styles/combined.css?spaceKey=SYNCOPE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Create+a+new+Syncope+project">Create
a new Syncope project</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~ilgrosso">Francesco
Chicchiricco</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >      &lt;/snapshots&gt; <br>
   &lt;/repository&gt; <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">
   &lt;repository&gt; <br></td></tr>
            <tr><td class="diff-unchanged" >  &lt;repositories&gt; <br>{code}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
div.rbtoc1334736551983 {margin-left: 1.5em;padding: 0px;}
div.rbtoc1334736551983 ul {list-style: decimal;margin-left: 0px;}
div.rbtoc1334736551983 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1334736551983'>
<ul>
    <li><a href='#CreateanewSyncopeproject-Introduction'>Introduction</a></li>
    <li><a href='#CreateanewSyncopeproject-Prerequisites'>Prerequisites</a></li>
    <li><a href='#CreateanewSyncopeproject-Createnewproject'>Create new project</a></li>
<ul>
    <li><a href='#CreateanewSyncopeproject-Stablereleases'>Stable releases</a></li>
    <li><a href='#CreateanewSyncopeproject-Snapshot%28development%29releases'>Snapshot
(development) releases</a></li>
</ul>
    <li><a href='#CreateanewSyncopeproject-Buildnewproject'>Build new project</a></li>
    <li><a href='#CreateanewSyncopeproject-Wheretogofromhere%3F'>Where to go from
here?</a></li>
</ul></div>
<h1><a name="CreateanewSyncopeproject-Introduction"></a>Introduction</h1>

<p>This document describes how to create a new Syncope project.<br/>
A Syncope project includes (at least) two web applications: the <b>core</b> and
the <b>console</b>. This page helps you get both web applications up and running
with your own project as quickly as possible.</p>

<h1><a name="CreateanewSyncopeproject-Prerequisites"></a>Prerequisites</h1>

<p>The preferred way to create a Syncope project is to generate a Maven project starting
from published archetype.</p>

<p>Hence you need:</p>

<ul>
	<li><a href="http://maven.apache.org" class="external-link" rel="nofollow">Apache
Maven</a> (version 3.0.3 or higher) installed;</li>
	<li>Some basic knowledge about Maven;</li>
	<li>Some basic knowledge about <a href="http://maven.apache.org/plugins/maven-war-plugin/overlays.html"
class="external-link" rel="nofollow">Maven WAR overlays</a>;</li>
	<li>Some basic knowledge about <a href="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html"
class="external-link" rel="nofollow">Maven archetypes</a>.</li>
</ul>


<h1><a name="CreateanewSyncopeproject-Createnewproject"></a>Create new project</h1>

<p>Maven archetypes are templates of projects. Maven can generate a new project from
such a template. For a project using Syncope, you need the website archetype. In the folder
in which the new project folder should be created, type the command shown below. On Windows,
run the command on a single line and leave out the line continuation characters ('\').</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn archetype:generate \
    -DarchetypeGroupId=org.apache.syncope \
    -DarchetypeArtifactId=syncope-archetype \
    -DarchetypeRepository=http:<span class="code-comment">//repo1.maven.org/maven2 \
</span>    -DarchetypeVersion=1.0.0-incubating
</pre>
</div></div>

<p>The archetype is configured with default values for all properties required by the
archetype. If you want to customize any of these property values, type 'n' when prompted for
confirmation.</p>

<p>You will be asked for:</p>
<ol>
	<li>the groupId, (something like 'com.mycompany')</li>
	<li>the artifactId (something like 'myproject')</li>
	<li>the version number (you can use the default, it is good practice to have 'SNAPSHOT'
in the version number during development and the maven release plugin makes use of that string.
But ensure to comply to the desired numbering scheme for your project).</li>
	<li>the package name. This is the java package name. A folder structure according to
this name will be generated automatically. Use the default, which is equal to the groupId.</li>
</ol>


<p>Maven will create a project for you (in a newly created directory named after the
value of the artifactId property you specified) containing two subprojects:</p>
<ol>
	<li>core - a pre-configured RESTful server, with JPA persistence</li>
	<li>console - a web interface for dealing with the core</li>
</ol>


<h2><a name="CreateanewSyncopeproject-Stablereleases"></a>Stable releases</h2>

<p>Take a look at available releases of the archetype project at <a href="http://repo1.maven.org/maven2/org/apache/syncope/syncope-archetype"
class="external-link" rel="nofollow">central Maven repository</a>, then change the
<tt>archetypeVersion</tt> in the mvn command above accordingly.</p>

<h2><a name="CreateanewSyncopeproject-Snapshot%28development%29releases"></a>Snapshot
(development) releases</h2>

<p>As development go on, snapshot releases are published at <a href="http://repository.apache.org/content/repositories/snapshots/org/apache/syncope/syncope-archetype"
class="external-link" rel="nofollow">ASF repository</a>.</p>

<p>If you want to test a snapshot release, be sure to:</p>
<ol>
	<li>change 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//repo1.maven.org/maven2</span></pre>
</div></div>
<p> to </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//repository.apache.org/content/repositories/snapshots</span></pre>
</div></div>
<p> in the mvn command above</p></li>
	<li>add the following code right before <tt>&lt;/project&gt;</tt>
in root <tt>pom.xml</tt> of the generated project:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
  &lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;ASF&lt;/id&gt;
      &lt;url&gt;https:<span class="code-comment">//repository.apache.org/content/repositories/snapshots/&lt;/url&gt;
</span>      &lt;snapshots&gt;
        &lt;enabled&gt;<span class="code-keyword">true</span>&lt;/enabled&gt;
      &lt;/snapshots&gt;
    &lt;/repository&gt;
  &lt;repositories&gt;
</pre>
</div></div></li>
</ol>



<h1><a name="CreateanewSyncopeproject-Buildnewproject"></a>Build new project</h1>

<p>Now build your project using the following command in the root folder of your project:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean <span class="code-keyword">package</span>
</pre>
</div></div>

<p>This will produce two WAR files:</p>
<ul>
	<li>core/target/syncope.war</li>
	<li>console/target/syncope-console.war</li>
</ul>


<h1><a name="CreateanewSyncopeproject-Wheretogofromhere%3F"></a>Where to
go from here?</h1>

<p>Once you have create your project and verified that build went fine, you can now
see how to <a href="/confluence/display/SYNCOPE/Run+Syncope+in+embedded+mode" title="Run
Syncope in embedded mode">run an embedded demo</a> or <a href="/confluence/display/SYNCOPE/Run+Syncope+in+real+environments"
title="Run Syncope in real environments">deploy to a real environment</a>.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Create+a+new+Syncope+project">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27841574&revisedVersion=10&originalVersion=9">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Create+a+new+Syncope+project?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message