<!DOCTYPE html>


<!--
 | Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/xdoc/dev/collaboration.xml at 2025-02-23
 | Rendered using Apache Maven Fluido Skin 1.12.0
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" />
    <meta name="author" content="Emmanuel Hugonnet" />
    <meta name="author" content="Miguel Moquillon" />
    <title>Silverpeas Project Web Site &#x2013; Contributing to Silverpeas</title>
    <link rel="stylesheet" href="../css/apache-maven-fluido-1.12.0.min.css" />
    <link rel="stylesheet" href="../css/site.css" />
    <link rel="stylesheet" href="../css/print.css" media="print" />
    <script src="../js/apache-maven-fluido-1.12.0.min.js"></script>
    <!-- Google Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-2015926-3', 'auto');
      ga('send', 'pageview');
      ga('set', 'anonymizeIp', true);
      ga('set', 'forceSSL', true);
    </script>
    <style>.github-fork-ribbon:before { background-color: orange; }</style>
  </head>
  <body class="topBarEnabled">
    <a class="github-fork-ribbon right-top" href="https://github.com/Silverpeas" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
    <header id="topbar" class="navbar navbar-fixed-top navbar-inverse">
      <div class="navbar-inner">
            <div class="container">
              <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
              </a>
          <nav class="nav-collapse">
            <ul class="nav">
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown">Silverpeas <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li><a href="../intro.html" title="About">About</a></li>
            <li><a href="../product/features.html" title="Key Features">Key Features</a></li>
            <li class="dropdown-submenu">
<a href="../product/applications.html" title="Applications">Applications</a>
              <ul class="dropdown-menu">
                  <li><a href="../product/social_network.html" title="Social Network">Social Network</a></li>
                  <li><a href="../product/documentation_management.html" title="Electronic Documentation Management">Electronic Documentation Management</a></li>
                  <li><a href="../product/content_management.html" title="Content Management">Content Management</a></li>
                  <li><a href="../product/data_collection.html" title="Data Collection">Data Collection</a></li>
                  <li><a href="../product/gallery.html" title="Pictures Management">Pictures Management</a></li>
                  <li><a href="../product/knowledge_management.html" title="Knowledge Management">Knowledge Management</a></li>
                  <li><a href="../product/project_documentation.html" title="Project Documentation">Project Documentation</a></li>
              </ul>
            </li>
            <li><a href="../screenshots.html" title="Screenshots">Screenshots</a></li>
            <li class="dropdown-submenu">
<a href="../installation/index.html" title="Install Silverpeas">Install Silverpeas</a>
              <ul class="dropdown-menu">
                  <li><a href="../installation/installationV6.html" title="Installation of Silverpeas 6">Installation of Silverpeas 6</a></li>
                  <li><a href="../installation/cloud.html" title="Silverpeas in the Cloud">Silverpeas in the Cloud</a></li>
                  <li><a href="../installation/webdav.html" title="Online Edition of Documents">Online Edition of Documents</a></li>
              </ul>
            </li>
            <li class="dropdown-submenu">
<a href="../#" title="Our versions">Our versions</a>
              <ul class="dropdown-menu">
                  <li><a href="https://tracker.silverpeas.org/projects/silverpeas/roadmap" title="Roadmap">Roadmap</a></li>
                  <li><a href="https://tracker.silverpeas.org/projects/silverpeas/roadmap?completed=1&with_subprojects=1" title="Changelog">Changelog</a></li>
                  <li><a href="../releasenotes.html" title="Release Notes">Release Notes</a></li>
              </ul>
            </li>
            <li><a href="../scm.html" title="Source Code">Source Code</a></li>
            <li class="dropdown-submenu">
<a href="../#" title="Some Configuration Tips">Some Configuration Tips</a>
              <ul class="dropdown-menu">
                  <li><a href="../configuration/ldap.html" title="LDAP Synchronization">LDAP Synchronization</a></li>
                  <li><a href="../configuration/proxy.html" title="Configuring a reverse-proxy">Configuring a reverse-proxy</a></li>
              </ul>
            </li>
            <li><a href="../faq.html" title="FAQ">FAQ</a></li>
        </ul>
      </li>
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown">Silverpeas Projects <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li class="dropdown-submenu">
<a href="../#" title="Global information">Global information</a>
              <ul class="dropdown-menu">
                  <li><a href="../intro.html" title="About Silverpeas">About Silverpeas</a></li>
                  <li><a href="../team.html" title="Team">Team</a></li>
                  <li><a href="../mailing-lists.html" title="Mailing List">Mailing List</a></li>
                  <li><a href="../issue-management.html" title="Issue Tracking">Issue Tracking</a></li>
                  <li><a href="../source-repository.html" title="Source Repository">Source Repository</a></li>
                  <li><a href="../ci-management.html" title="Continuous Integration">Continuous Integration</a></li>
              </ul>
            </li>
            <li><a href="../docs/core/index.html" title="Silverpeas Core">Silverpeas Core</a></li>
            <li><a href="../docs/components/index.html" title="Silverpeas Applications">Silverpeas Applications</a></li>
        </ul>
      </li>
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown">How to contribute <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li><a title="Contribution">Contribution</a></li>
            <li><a href="../dev/quality.html" title="Code Quality">Code Quality</a></li>
            <li><a href="../dev/ldap_testing.html" title="Testing the LDAP code">Testing the LDAP code</a></li>
        </ul>
      </li>
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown">Licensing <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li><a href="../legal/licensing_gnu_affero.html" title="License">License</a></li>
            <li><a href="../legal/licensing_faq.html" title="Licensing FAQ">Licensing FAQ</a></li>
            <li><a href="../legal/floss_exception.html" title="FLOSS Exception">FLOSS Exception</a></li>
            <li><a href="../legal/trademark.html" title="Silverpeas Trade Mark">Silverpeas Trade Mark</a></li>
        </ul>
      </li>
            </ul>
          </nav>
          <div class="nav-collapse">
          </div>
        </div>
      </div>
    </header>
    <div class="container container-top">
      <header>
        <div id="banner">
          <div class="pull-left"><a href="https://www.silverpeas.org/" id="bannerLeft"><img src="../images/logo-silverpeas.png"  alt="Silverpeas" style="" /></a></div>
          <div class="pull-right"></div>
          <div class="clear"><hr/></div>
        </div>

        <div id="breadcrumbs">
          <ul class="breadcrumb">
      <li><a href="https://www.silverpeas.org" class="externalLink" title="Silverpeas">Silverpeas</a><span class="divider">/</span></li>
    <li class="active ">Contributing to Silverpeas</li>
        <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2025-02-23</li>
          <li id="projectVersion" class="pull-right">Version: 6.4.2</li>
          </ul>
        </div>
      </header>
        <main id="bodyColumn" >


  
    <section>
<h2><a name="Git"></a>Git</h2>
      <section>
<h3><a name="What_is_git.3F"></a>What is git?</h3>
        
<p>
          <img src="../images/logos/logo_git.png" alt="git logo" style="height:30px;padding-right:10px;float:left;position:relative;" />
          <a class="externalLink" href="http://git-scm.com/">Git</a> is a Distributed Version Control System (DVCS).
      The main difference with VCS is its distributed form, which means that
      there is not a single repository centralizing all the code history.
          <br />All the code history is in each repository, which
      means that you have all the history in your local repository as well as in the others.
        </p>
        
<p>
      Git works like the following figure:
        </p>
        
<ul>
          
<li>you add new or modified files and remove deleted files to your staging repository.</li>
          
<li>when all your changes make sense you commit them to your local repository.</li>
          
<li>now, you can share your modifications whith the rest of the world by pushing them to a remote repository.</li>
          
<li>to get others' modifications pull or fetch them from a remote repository.</li>
        </ul>
        
<p>
          <a href="../images/git_everthing_is_local.png">
            <img src="../images/git_everthing_is_local.png" alt="git workflow" style="height:404px;padding-left:100px;" />
          </a>
        </p>
        
<p>For more information how to use Git, please visit the
          <a class="externalLink" href="http://gitref.org/">Git Reference</a> web site.
        </p>
      </section>
      <section>
<h3><a name="Why_Git.3F"></a>Why Git?</h3>
        
<p>Silverpeas is a free and libre project that values meritocracy.
          <i>In code we believe!</i>
          <br />
      As we switched to the Git distributed source control system, we heavily blured the distinction between official project developers and external contributors.
      This makes it easier for you to:
        </p>
        
<ul>
          
<li>prepare changes, and for us to eventually merge them</li>
          
<li>maintain your own private modifications of Silverpeas</li>
          
<li>later split your own modifications and submit them back to us.</li>
        </ul>
      </section>
      <section>
<h3><a name="Github"></a>Github</h3>
        
<p>
          <img src="../images/logos/logo_github.jpg" alt="github logo" style="height:40px;padding-right:10px;float:left;position:relative;" />
          Silverpeas's code is hosted on public Git repositories on GitHub, so that everybody can participate and contribute to the Silverpeas project.
          <br />
          The Github features enhance the capabilities of a collaborative and distributed work.
        </p>
      </section>
    </section>
    <section>
<h2><a name="How_to_contribute"></a>How to contribute</h2>
      <section>
<h3><a name="Forking_Silverpeas"></a>Forking Silverpeas</h3>
        
<p>
          First, you have to
          <a class="externalLink" href="https://docs.github.com/">create your account on Github</a>, then fork the
          <a class="externalLink" href="https://github.com/Silverpeas">Silverpeas repositories</a> you are interested in.
        </p>
        
<p>For information, Silverpeas is made up of the following projects, each of them with their
          own Git repository:</p>
        
<ul>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/silverpeas-dependencies-bom"><code>Silverpeas Dependencies</code></a> that
            is a global descriptor defining all the dependencies with their version and their scope required to build and to run
            Silverpeas. Usually, you won't have to modify this project.</li>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/silverpeas-test-dependencies-bom"><code>Silverpeas Test Dependencies</code></a> that
            is a global descriptor defining all the dependencies with their version required to run the unit and integrations tests.
            Usually, you won't have to modify this project.</li>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/Silverpeas-Project"><code>Silverpeas Project</code></a> that
          is a global descriptor for many of the Silverpeas projects: it imports the descriptors above and defines plugins and profiles to
            build Silverpeas according to different contexts. Usually, you won't have to modify this project.</li>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/Silverpeas-Core"><code>Silverpeas Core</code></a> in which
          are defined the Core APIs of Silverpeas for both the business part and the Web part.</li>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/Silverpeas-Components"><code>Silverpeas Components</code></a> that
          comprise all of the applications provided by Silverpeas (DEM, gallery, blog, ...)</li>
          
<li><a class="externalLink" href="https://github.com/Silverpeas/Silverpeas-Assembly"><code>Silverpeas Assembly</code></a> is
          a project that declares all the components that made up the Silverpeas collaborative platform and that
          defines the rules to build from them the final Silverpeas application, ready to be deployed into a JEE
          runtime.</li>
        </ul>
        
<p>Once the fork completed, clone it:</p>
        
<div class="source"><pre class="prettyprint">git clone URL_OF_THE_FORK</pre></div>
        
<p>Your fork is then referenced by your git configuration with the name <code>origin</code></p>
        
<p>
          In order to keep your fork up-to-date, you will have to pull modifications from the Silverpeas repository. Thus, you
          have to add a remote repository to your git configuration linking your local repository to the Silverpeas one. The
          recommended name (used afterwards in he documentation) is
          <code>silverpeas</code>.
          <br />
          To add a remote repository to your local, execute the following command:
        </p>
        
<div class="source"><pre class="prettyprint">git remote add silverpeas URL_OF_SILVERPEAS_REPOSITORY</pre></div>
        
<p>For example:</p>
        
<div class="source"><pre class="prettyprint">git remote add silverpeas git@github.com:Silverpeas/Silverpeas-Core.git</pre></div>
        
<p>To synchronize your local repository with Silverpeas, we recommend to execute the following command:</p>
        
<div class="source"><pre class="prettyprint">git pull --rebase silverpeas master</pre></div>
        
<p>Or to be less confusing by unexpected merge conflicts, you can divide the synchronization in two steps:</p>
        
<div class="source"><pre class="prettyprint">git fetch silverpeas master
git rebase FETCH_HEAD</pre></div>
        
<p>The <code>rebase</code> operation while synchronizing your local repository with Silverpeas is to ensure
        your changes will be on top of the fetched modifications and hence they won't be mixed with external commits.
        By doing this, when we'll merge your changes, the history of Silverpeas changes will be clean and understandable.</p>
      </section>
      <section>
<h3><a name="Build_Silverpeas"></a>Build Silverpeas</h3>
        
<p>We use the <a class="externalLink" href="https://www.oracle.com/java/technologies/downloads/#java11">Java Development Kit 11</a> (Oracle JDK or OpenJDK 11)
          and the <a class="externalLink" href="http://maven.apache.org/">maven build tool</a> to manage the build life-cycle of our projects. With Maven,
          a project is described by a POM (Project Object Model) that is defined in the <code>pom.xml</code> file at the root of the
          project. Maven provides at least the following features:</p>
        
<ul>
          
<li>a predefined directories layout for both sources code and build results,</li>
          
<li>a build workflow in which each stages are well defined,</li>
          
<li>a dependency management by using both a local and a remote repository in which the dependencies (named artifacts) are available.</li>
        </ul>
        
<p>Before building your copy of a Silverpeas project, you have to define some settings to Maven like indicating
          our own <a class="externalLink" href="https://www.silverpeas.org/nexus">Maven repository</a>. For doing, please edit a file <code>settings.xml</code>
          in the <code>.m2</code> directory at your home folder and add the following lines:</p>
        
<div class="source"><pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/SETTINGS/1.0.0&quot;
          xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
          xsi:schemaLocation=&quot;http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;
  &lt;mirrors&gt;
    &lt;mirror&gt;
      &lt;id&gt;silverpeas&lt;/id&gt;
      &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
      &lt;url&gt;https://www.silverpeas.org/nexus/content/groups/silverpeas/&lt;/url&gt;
    &lt;/mirror&gt;
  &lt;/mirrors&gt;

  
&lt;/settings&gt;
        </pre></div>
        
<p>Once done, you are ready to build the project:</p>
        
<div class="source"><pre class="prettyprint">mvn clean install</pre></div>
        
<p>or without running the tests:</p>
        
<div class="source"><pre class="prettyprint">mvn clean install -Dmaven.test.skip=true</pre></div>
        
<p>In order to build the Silverpeas application,
          you have to build first <code>Silverpeas-Core</code> and then <code>Silverpeas-Components</code>.
          If you have modified <code>silverpeas-dependencies-bom</code>, <code>silverpeas-test-dependencies-bom</code>,
        <code>Silverpeas-Project</code>, you have to compile first this project before anything.</p>
        
<p>In the case you have added a new application, you can reference it into the <code>POM</code>
        of the <code>Silverpeas-Assembly</code> project.</p>

      </section>
      <section>
<h3><a name="Installing_and_testing_your_codes"></a>Installing and testing your codes</h3>
        
<p>Beside the unit and integration tests, you can test functionally your code in Silverpeas by
        installing it with your changes.</p>
        
<p>The project <code>Silverpeas-Distribution</code> is the source code to generate the
          Silverpeas installation archives for both Windows and Unix-like systems. You can also build it
          by executing the following command:</p>
        
<div class="source"><pre class="prettyprint">mvn clean package</pre></div>
        
<p>and the archives will be generated into the <code>target</code> directory of the project.
        Then just extract it, set correctly the environment variables <code>SILVERPEAS_HOME</code>
        and <code>JBOSS_HOME</code> and follows the instructions in the
          <a href="../installation/installationV6.html">Silverpeas installation page</a>.</p>
        
<p>Once done, you are ready to run Silverpeas either in debugging mode or in a normal mode
        to test it. For doing, go to the folder <code>SILVERPEAS_HOME/bin</code> directory and then:</p>
        
<div class="source"><pre class="prettyprint">./silverpeas clean install</pre></div>
        
<p>to clean any previous installation of Silverpeas and install your own changes,</p>
        
<div class="source"><pre class="prettyprint">./silverpeas start</pre></div>
        
<p>to run Silverpeas in normal mode,</p>
        
<div class="source"><pre class="prettyprint">./silverpeas debug</pre></div>
        
<p>to run Silverpeas in debugging mode,</p>
        
<div class="source"><pre class="prettyprint">./silverpeas stop</pre></div>
        
<p>to stop Silverpeas.</p>
      </section>
      <section>
<h3><a name="Creating_a_development_branch"></a>Creating a development branch</h3>
        
<p>Now that you have your own repository, let's create a branch to develop some code in it.
        The branch name should reflect the development feature or bug you are working on. It exists
        two main ways to handle the local and remote branchs with Gits.
        </p>
        
<p>The first approach is to create the branch in local, then pushes it to the fork and sets the local branch to track the remote one:</p>
        
<div class="source"><pre class="prettyprint">git branch BRANCH_NAME
git push origin BRANCH_NAME
git branch --set-upstream BRANCH_NAME origin/BRANCH_NAME</pre></div>
        
<p>The second approach is to create the branch in your fork, then creates from it a local branch that will also track it:</p>
        
<div class="source"><pre class="prettyprint">git push origin master:refs/heads/BRANCH_NAME
git branch --track BRANCH_NAME origin/BRANCH_NAME</pre></div>
        
<p>or to create remotely a branch from another one:</p>
        
<div class="source"><pre class="prettyprint">git push origin EXISTING_BRANCH:refs/heads/BRANCH_NAME
git branch --track BRANCH_NAME origin/BRANCH_NAME</pre></div>
        
<p>Now you can switch your working directory to the branch you have created (id est checkout the branch):</p>
        
<div class="source"><pre class="prettyprint">git checkout  BRANCH_NAME</pre></div>
        
<p>When all your modifications are commited, it is time to push them to your remote branch.</p>
        
<div class="source"><pre class="prettyprint">git push</pre></div>
      </section>
      <section>
<h3><a name="Integrating_your_changes_in_Silverpeas"></a>Integrating your changes in Silverpeas</h3>
        
<p>Now that your development is ended, you may want to integrate it into Silverpeas.
          <br />
        To do this we take advantage of
          <a class="externalLink" href="http://help.github.com/pull-requests/">Github's &quot;Pull Request&quot; feature</a>.
        </p>
        
<p>On receiving your pull request, the Silverpeas core team will look into it and may give you some remarks.
          <br />
        When your code is accepted it will be merged into Silverpeas master branch and you will be informed of this.
          <br />
        Don't forget to synchronize both your repository and your fork with Silverpeas's in order to be up to date. We'll be pleased that you do it before any pull requests.
        </p>
        
<div class="source"><pre class="prettyprint">git checkout master
git pull silverpeas master
git push
        </pre></div>
        
<p>Your development branches for the integrated code are now obsolete, so you may want to delete them.</p>
        
<div class="source"><pre class="prettyprint">git push origin :BRANCH_NAME
git branch -D BRANCH_NAME</pre></div>
      </section>
    </section>
  

        </main>
    </div>
    <hr/>
    <footer>
      <div class="container">
        <div class="row">
<div class="license">
        <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>.
      </div>
        </div>
        <p id="poweredBy" class="pull-right"><a href="https://netbeans.apache.org/download/index.html" title="IDEA IntelliJ" class="builtBy"><img class="builtBy"  alt="IDEA IntelliJ" src="../images/logos/intellij-idea-logo.png" style="" /></a>
<a href="https://www.eclipse.org" title="Eclipse" class="builtBy"><img class="builtBy"  alt="Eclipse" src="../images/logos/logo_eclipse.png" style="" /></a>
<a href="https://maven.apache.org/" title="Maven" class="builtBy"><img class="builtBy"  alt="Maven" src="../images/logos/logo_maven.png" style="" /></a>
<a href="https://izpack.org/" title="Izpack" class="builtBy"><img class="builtBy"  alt="Izpack" src="../images/logos/logo_izPack.png" style="" /></a>
</p>
      </div>
    </footer>
<script>
  if(anchors) {
    anchors.add();
  }
</script>
  </body>
</html>