//  ========================================================================
//  Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
//  ========================================================================
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================

[[contributing-source-build]]
=== Source Control and Building

If you want to contribute to the development of jetty, you will need to work with a handful of technologies.

[[contributing-source]]
==== Source Control

Jetty uses several development trunks for its artifacts.
They are mirrored on github through http://github.com/eclipse, or you can look through them via the Eclipse setup at the URLs below.

===== Primary Interest SCM URLs

These are the URLs to the GIT repositories for the Jetty code.
They are for people who are working on the Jetty project, as well as for people who are interested in examining or modifying the Jetty code for their own projects.

Jetty Project Repository::
  https://github.com/eclipse/jetty.project

===== Build and Project Infrastructure SCM URLs

These are the URLs for Jetty-related code and metadata.
These are not needed to use Jetty; these are primarily of use for people who are working with Jetty-the-project (as opposed to using Jetty-the-server in their own projects).

Administrative pom.xml file::
  https://github.com/eclipse/jetty.parent
Build related artifacts that release separately, common assembly descriptors, remote resources, etc.::
  https://github.com/eclipse/jetty.toolchain
Files associated with the development of Jetty -- code styles, formatting, iplogs, etc.::
  http://git.eclipse.org/c/jetty/org.eclipse.jetty.admin.git

==== Build

Jetty requires the use of Java 7 and the latest releases are always recommended to build.

Jetty uses http://maven.apache.org/[Apache Maven 3] for managing its build and primary project metadata.

Building Jetty should simply be a matter of changing into the relevant directory and executing the following commands:

[source, screen, subs="{sub-order}"]
....

$ git clone https://github.com/eclipse/jetty.project.git
$ cd jetty.project
$ mvn install

    
....

All relevant dependencies will be downloaded into your local repository automatically.

____
[NOTE]
Jetty has a great many test cases that run through the course of its build.
Periodically we find some test cases to be more time dependent than they should be and this results in intermittent test failures.
You can help track these down by opening a bug report.
____

==== Import into Eclipse

Jetty is a Maven project. To develop Jetty in Eclipse, follow these directions:

===== Install m2e plugin

1.  From the Eclipse menu at the top of the screen, select _Help > Eclipse Marketplace._
2.  Search for __m2e__.
3.  Install the _Maven Integration for Eclipse_

===== Clone the git repository

Using either the egit plugin or git on the commandline (as in the build section above), obtain the jetty source.

===== Import the Maven Projects

1.  From the Eclipse menu, select _File > Import_
2.  From the Maven folder, select _Existing Maven Projects._
3.  Click __Next__.
4.  In the Import Maven projects pane, click _Browse_ and select the top folder of the jetty source tree.
5.  Click _Next/Finish_ to import all of jetty into Eclipse.
6.  Wait for Eclipse and m2e to compilie and set up the project.
