<commit_before><?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.    
-->
<document>

 <properties>
  <title>Apache James Server 3 - Build Apache James from Source</title>
</properties>

<body>

  <section name="Why Build from Source?">

    <p>This step is not necessary to use the standard out of the box version of James.  A
       pre-built binary version of James is available from the James download directory.</p>

     <p>But if you wish to customize the James source code, it will be necessary for you to
        build the distribution yourself.</p>

     <p>You can read on this page how to build from the command line and from eclipse IDE.</p>

  </section>

  <section name="Get Source Code">

    <p>There are two ways to get the James source code.</p>

    <ol>
      <li>Download the source distribution - the source is available from the
          <a href="http://james.apache.org/download.cgi">James release mirrors</a>.
          Simply choose the version of James you'd like to download, and pick the source
          distribution appropriate for your platform.</li>
      <li>Get the source code using SVN - this method gives you access to the cutting edge code
          base.  Instructions on how to use SVN to get the James source code
          can be found <a href="http://www.apache.org/dev/version-control.html">here</a>.
          Apache James Server beta1 repository is <a href="http://svn.apache.org/repos/asf/james/server/tags/james-server-3.0-beta4/">http://svn.apache.org/repos/asf/james/server/tags/james-server-3.0-beta4/</a>.</li>
      <li>For information, you can download all Apache James sources (server, mailbox, imap, mailet...) if you check out <a href="http://svn.apache.org/repos/asf/james/current">http://svn.apache.org/repos/asf/james/current/</a>.
         Watch out!: you will get a release, but what we call a "trunk", that is on constant development and debugging.</li>
    </ol>

    <p>We consider in this document that you have checked-out James source code in JAMES_SRC_HOME directory.</p>

    <p>Consult the <a href="dev.html">architecture</a> page if you want to learn
    more on the internal source structure.</p>

  </section>

  <section name="Required Tools">

    <p>To run the build you need two third-party tools.</p>
    <ol>
      <li>Java Development Kit - You must have a JDK of Java version 1.6 or higher installed to build the
          James distribution.  The exact JDKs available depend on the platform.  A JDK must be downloaded and
          installed before the build can run.</li>
      <li>Maven 3.0.2 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.0.2+) in order
          to build James. You can get maven 3.0.2 from <a href="http://maven.apache.org/download.html">here</a>.
          Installation instructions for maven are also available on the same page <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a>.</li>
    </ol>
    <p>Set (on windows) or export (on Unix) MAVEN_OPTS to tune the memory needed by maven with "MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=128m"</p>

  </section>

  <section name="Build James Source from Command Line">

    <p>In the JAMES_SRC_HOME top level directory (where the parent pom.xml resides), invoke maven with 'mvn' with any of the following command line arguments:
    <ul>
      <li>clean - deletes the target directory, making the system ready for a clean build.</li>
      <li>compile - compiles the source code.</li>
      <li>test - run unit tests for James.</li>
      <li><b>package - generates all the James distributions, packed.
      From the root directory, cd to 'container-spring/target' to have the build distribution.
      Notice, for the latest trunk(revision 1430655+), a specific profile argument need to be set: '-Pwith-assembly'.
      The location of final distributions is also changed to 'JAMES_SRC_HOME/server/app/target'.</b></li>
      <li>javadocs:javadocs - builds the James javadocs.</li>
      <li>site - builds the entirety of the James website.</li>
    </ul>
    </p>
    <p>For example, invoke <code>mvn package</code> to get a zip/tar of James distribution.</p>
    <p>All built products are output in the <code>container-spring/target</code>
      subdirectory of the James source directory.
      This directory will be deleted if you run build with the clean argument.</p>
    <p><strong>Warning!</strong> Any changes you've made in the 'dist' directory
      will be lost after a recompilation. If you are running James for this directory
      we recommend you backup to avoid losing work. </p>
    <p>You can also invoke the command line from a shell. Go to the server project cli folder and type mvn exec:java -Dexec.args="-h localhost -p 9999 help"</p>

  </section>

  <section name="Build James Source from Eclipse">

    <subsection name="Import projects in Eclipse with m2eclipse">
<commit_msg>Add link to external blog to build in eclipse<commit_after><?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.    
-->
<document>

 <properties>
  <title>Apache James Server 3 - Build Apache James from Source</title>
</properties>

<body>

  <section name="Why Build from Source?">

    <p>This step is not necessary to use the standard out of the box version of James.  A
       pre-built binary version of James is available from the James download directory.</p>

     <p>But if you wish to customize the James source code, it will be necessary for you to
        build the distribution yourself.</p>

     <p>You can read on this page how to build from the command line and from eclipse IDE.</p>

  </section>

  <section name="Get Source Code">

    <p>There are two ways to get the James source code.</p>

    <ol>
      <li>Download the source distribution - the source is available from the
          <a href="http://james.apache.org/download.cgi">James release mirrors</a>.
          Simply choose the version of James you'd like to download, and pick the source
          distribution appropriate for your platform.</li>
      <li>Get the source code using SVN - this method gives you access to the cutting edge code
          base.  Instructions on how to use SVN to get the James source code
          can be found <a href="http://www.apache.org/dev/version-control.html">here</a>.
          Apache James Server beta1 repository is <a href="http://svn.apache.org/repos/asf/james/server/tags/james-server-3.0-beta4/">http://svn.apache.org/repos/asf/james/server/tags/james-server-3.0-beta4/</a>.</li>
      <li>For information, you can download all Apache James sources (server, mailbox, imap, mailet...) if you check out <a href="http://svn.apache.org/repos/asf/james/current">http://svn.apache.org/repos/asf/james/current/</a>.
         Watch out!: you will get a release, but what we call a "trunk", that is on constant development and debugging.</li>
    </ol>

    <p>We consider in this document that you have checked-out James source code in JAMES_SRC_HOME directory.</p>

    <p>Consult the <a href="dev.html">architecture</a> page if you want to learn
    more on the internal source structure.</p>

  </section>

  <section name="Required Tools">

    <p>To run the build you need two third-party tools.</p>
    <ol>
      <li>Java Development Kit - You must have a JDK of Java version 1.6 or higher installed to build the
          James distribution.  The exact JDKs available depend on the platform.  A JDK must be downloaded and
          installed before the build can run.</li>
      <li>Maven 3.0.2 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.0.2+) in order
          to build James. You can get maven 3.0.2 from <a href="http://maven.apache.org/download.html">here</a>.
          Installation instructions for maven are also available on the same page <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a>.</li>
    </ol>
    <p>Set (on windows) or export (on Unix) MAVEN_OPTS to tune the memory needed by maven with "MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=128m"</p>

  </section>

  <section name="Build James Source from Command Line">

    <p>In the JAMES_SRC_HOME top level directory (where the parent pom.xml resides), invoke maven with 'mvn' with any of the following command line arguments:
    <ul>
      <li>clean - deletes the target directory, making the system ready for a clean build.</li>
      <li>compile - compiles the source code.</li>
      <li>test - run unit tests for James.</li>
      <li><b>package - generates all the James distributions, packed.
      From the root directory, cd to 'container-spring/target' to have the build distribution.
      Notice, for the latest trunk(revision 1430655+), a specific profile argument need to be set: '-Pwith-assembly'.
      The location of final distributions is also changed to 'JAMES_SRC_HOME/server/app/target'.</b></li>
      <li>javadocs:javadocs - builds the James javadocs.</li>
      <li>site - builds the entirety of the James website.</li>
    </ul>
    </p>
    <p>For example, invoke <code>mvn package</code> to get a zip/tar of James distribution.</p>
    <p>All built products are output in the <code>container-spring/target</code>
      subdirectory of the James source directory.
      This directory will be deleted if you run build with the clean argument.</p>
    <p><strong>Warning!</strong> Any changes you've made in the 'dist' directory
      will be lost after a recompilation. If you are running James for this directory
      we recommend you backup to avoid losing work. </p>
    <p>You can also invoke the command line from a shell. Go to the server project cli folder and type mvn exec:java -Dexec.args="-h localhost -p 9999 help"</p>

  </section>

  <section name="Build James Source from Eclipse">

    <p>Upon the following documentation, an interessting resource 
       <a href="http://blog.bonnydoonmedia.com/post.cfm/walkthrough-tutorials-compiling-apache-james-v3-with-eclipse">
       can be found here</a>
    </p>

    <subsection name="Import projects in Eclipse with m2eclipse">

{'fraction_non_alphanumeric': 0.0956014747492069, 'fraction_numerical': 0.007630969733344766, 'mean_word_length': 3.2337568058076225, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 2, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1977033', 'n_tokens_mistral': 3383, 'n_tokens_neox': 3227, 'n_words': 1426}