blob: 5113f05a4169e47cd61295777f5a7a107c60028c [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en"> <!--<![endif]-->
<head>
<title>M2Eclipse | Development Environment</title>
<!-- Meta -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="M2Eclipse provides tight integration for Apache Maven into the Eclipse IDE." />
<meta name="author" content="eclipse.org" />
<meta property="twitter:account_id" content="15710507" />
<!-- CSS Global Compulsory-->
<link rel="stylesheet" href="/m2e/assets/plugins/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="/m2e/assets/css/style.css" />
<link rel="stylesheet" href="/m2e/assets/css/m2eclipse.css" />
<link rel="shortcut icon" href="/m2e/assets/img/favicon.ico" />
<!-- CSS Implementing Plugins -->
<link rel="stylesheet" href="/m2e/assets/plugins/font-awesome/css/font-awesome.css" />
<!-- GA -->
<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-56202333-1', 'eclipse.org');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="wrap">
<div class="header">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-inner">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/m2e/index.html">
<img id="logo-header" src="/m2e/assets/img/m2e_logo.png" alt="M2Eclipse" width="150" height="61" />
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav navbar-left">
<li class="">
<a href="/m2e/m2e-news.html">News</a>
</li>
<li class="">
<a href="/m2e/m2e-downloads.html">Download</a>
</li>
<li class="">
<a href="/m2e/documentation/m2e-documentation.html">Documentation</a>
</li>
<li class="">
<a href="/m2e/m2e-community.html">Community</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div><!-- END header -->
<div class="margin-bottom-20"></div>
<div class="container">
<div class="margin-bottom-100"></div>
<div class="row">
<div class="col-md-3">
<div class="docNavigation affix">
<div class="margin-bottom-30"></div>
<h4 class="headline">Users</h2>
<ul class="unstyled">
<li><a href="/m2e/documentation/m2e-faq.html">FAQ</a></li>
<li><a href="/m2e/documentation/m2e-execution-not-covered.html">Execution Not Covered</a></li>
</ul>
<h4 class="headline">Developers</h2>
<ul class="unstyled">
<li><a href="/m2e/documentation/m2e-development-environment.html">Developement Environment Setup</a></li>
</ul>
<h4 class="headline">Extension Developers</h2>
<ul class="unstyled">
<li><a href="/m2e/documentation/m2e-extension-development.html">Getting Started</a></li>
<li><a href="/m2e/documentation/m2e-making-maven-plugins-compat.html">Making Maven Plugins Compatible</a></li>
</ul>
<h4 class="headline">Release Notes</h2>
<ul class="unstyled">
<li><a href="/m2e/documentation/release-notes-19.html">M2Eclipse 1.9</a></li>
<li><a href="/m2e/documentation/release-notes-18.html">M2Eclipse 1.8</a></li>
<li><a href="/m2e/documentation/release-notes-17.html">M2Eclipse 1.7</a></li>
<li><a href="/m2e/documentation/release-notes-16.html">M2Eclipse 1.6</a></li>
<li><a href="/m2e/documentation/release-notes-15.html">M2Eclipse 1.5</a></li>
</ul>
</div>
</div>
<div class="col-md-9 docs">
<h1><a href="#development-environment-setup" name="development-environment-setup">Development Environment Setup</a></h1>
<p>Download and unpack Eclipse latest SDK build from <a href="http://download.eclipse.org/eclipse/downloads/">http://download.eclipse.org/eclipse/downloads/</a>.
The instructions below assume fresh/clean Eclipse SDK installation.</p>
<p>Use the instructions at <a href="http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-124.htm">http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-124.htm</a>
to install &ldquo;Maven integration for Eclipse&rdquo; and &ldquo;Git integration for Eclipse&rdquo; from the standard update sites of the Eclipse SDK.
You can also find and install the most recent release of these plugins in the following P2 repository URLs, which can be added using the Eclipse
Install UI as explained in
<a href="http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-127.htm">http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-127.htm</a>:
<ul>
<li><a href="http://download.eclipse.org/technology/m2e/releases">http://download.eclipse.org/technology/m2e/releases</a></li>
<li><a href="https://download.eclipse.org/egit/updates/">https://download.eclipse.org/egit/updates/</a></li>
</ul>
</p>
<p>Some modules of the m2e core code make use of logback classic. When you later proceed to import projects, you will get errors in some (e.g. org.eclipse.m2e.logback.appender and
org.eclipse.m2e.logback.configuration) complaining that you are missing the ch.qos.logback.classic library in your Eclipse. The easiest way to install the &ldquo;Logback Classic
Module&rdquo; is to again use the instructions at <a href="http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-124.htm">http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tasks/tasks-124.htm</a>
to install the &ldquo;m2e - slf4j over logback logging&rdquo; optional plugin. This provides a maven console in your host workspace. Alternatively if you do not want that feature,
you need to at least inestall the &ldquo;Logback Classic Module&rdquo; plugin from <a href="https://download.eclipse.org/tools/orbit/downloads/">the Orbit repository</a>, so that
it is available in your host Eclipse.
</p>
<p>You should now have all plugins you need in your Eclipse to proceed with building the source code.</p>
<p>The code is split across two repositories:
<ul>
<li>The M2Eclipse Core repository, see <a href="https://git.eclipse.org/r/#/admin/projects/m2e/m2e-core">https://git.eclipse.org/r/#/admin/projects/m2e/m2e-core</a>
for the list of available protocols.</li>
<li>The M2Eclipse Core Tests repository, see <a href="https://github.com/tesla/m2e-core-tests">https://github.com/tesla/m2e-core-tests</a> for the list of available protocols.</li>
</ul>
</p>
<p>The latter is configured as a git submodule of the former. Either clone the first repository including submodules, or just clone both repositories separately. Either way, before
proceeding to import anything into you workspace, make sure you are on the matching branches of the m2e-core repository and the m2e-core-tests repository (whether that was cloned separately
or as a submodule). For example if you are on the master branch of m2e-core you should be on the master branch of m2e-core-tests as well. Otherwise you may get errors when oou import from the
latter, where the test projects will not be able to resolve the snapshot version of m2e core they are testing against.
</p>
<p>Once you are on the correct branch, perform a project import in this order:</p>
<ol>
<li>First import as Maven projects m2e-maven-runtime and all projects within it. These projects bundle the Maven runtime as Eclipse plugins.</li>
<li>Next import as Maven projects everything under m2e-core <em>but make sure you exclude anything under m2e-core-tests</em>. Expect m2e-core-tests projects to show up for import if you
cloned the latter as a submodule, which makes it manifest as a nested folder. <em>Furthermore, make sure you only import Maven projects and not any Eclipse projects</em>: You will find
many of the latter type nested deeply within m2e-core projects and they are all actually test-data resources not meant to live within your development (host) workspaces.
<ul>
<li><em>NOTE:</em> at this stage, m2eclipse should prompt you to install several m2e connectors for Tycho and Modello. As you
follow onscreen instructions, allow M2Eclipse to install additional software and restart Eclipse when requested.</li>
<li>Before importing further projects, you will need to go to <a href="https://help.eclipse.org/topic/org.eclipse.jdt.doc.user/reference/ref-properties-build-path.htm#source">the source tab of the Java Build Path properties</a>
of project org.eclipse.m2e.tests.common and toggle the &ldquo;Contains test sources&rdquo; setting to &lsquo;No&rsquo;.</li>
<li>Update the maven project configuration for all projects and do a clean build. Give Eclipse some time to update project configuration after restart.</li>
</ul>
</li>
<li>Finally, you can import as Maven projects the test projects m2e-core-tests. <em>NOTE: </em>Once again you will need to be careful to only import Maven projects. Do not import Eclipse
projects. The latter will be nested deeply within m2e-core-tests projects and are actually test-data resources not meant to live within your development (host) workspaces.
</li>
</ol>
</p>
<p>You may need to Update Maven (forcing update of snapshot releases) and do Project/Clean&hellip;/Clean_all_projects to clear all compilation errors.</p>
<h2><a href="#running-m2eclipse-automated-regression-tests-from-eclipse" name="running-m2eclipse-automated-regression-tests-from-eclipse">Running M2Eclipse Automated Regression Tests from Eclipse</a></h2><p>Add the following memory configuration parameters to JVM startup options</p>
<pre class="prettyprint linenums">
-Xmx1G
</pre><p>Use JUnit Plug-in Tests launch configuration type to run/debug M2Eclipse automated regressions tests from Eclipse.</p><p>Caveat. Two tests are expected to fail when run from Eclipse</p>
<ol>
<li><p>ProjectRegistryManagerTest#testEnvironmentVariablesConsidered requires TEMP environment variable to be set and is expected to failed when run from Eclipse.</p></li>
<li><p>MarkerTest#test is rather sloppy and requires elaborate launch configuration setup to limit set of m2e extensions enabled during the test.</p></li>
</ol><p>Both tests are expected to pass on command line (see instructions below).</p><h2><a href="#building-m2eclipse-on-the-cli" name="building-m2eclipse-on-the-cli">Building M2Eclipse on the CLI</a></h2><p>Building m2e on command line is a two step process, both performed from root of m2e-core checkout directory</p><p>First, you need to <em>install</em> m2e maven runtime to local maven repository</p>
<pre class="prettyprint linenums">
mvn clean install -f m2e-maven-runtime/pom.xml`
</pre><p>Then, package M2Eclipse update site:</p>
<pre class="prettyprint linenums">
mvn clean package
</pre><p>The repository is created under org.eclipse.m2e.site/target/repository directory.</p><h2><a href="#running-m2eclipse-automated-regression-tests-on-the-cli" name="running-m2eclipse-automated-regression-tests-on-the-cli">Running M2Eclipse Automated Regression Tests on the CLI</a></h2><p>To run m2e automated regression tests, execute the following command from m2e-core-tests checkout directory</p>
<pre class="prettyprint linenums">
mvn clean integration-test -Puts,its -fae -Dm2e-core.url=file://&lt;full-path-to-m2e-repository&gt;
</pre><h2><a href="#submitting-patches" name="submitting-patches">Submitting Patches</a></h2><h3>M2Eclipse Core Sources at Eclipse.org</h3><p>M2Eclipse only accepts changes contributed via Gerrit. Here is the wiki that explains how to use it <a href="http://wiki.eclipse.org/Gerrit">http://wiki.eclipse.org/Gerrit</a> . Good luck.</p><p>According to <a href="http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf">eclipse legal poster</a>, all contributors must have signed Eclipse CLA and their bugzilla email and git commit author must match (otherwise Eclipse git server refuses contribution).</p><p>Note that M2Eclipse developers do NOT watch Gerrit submissions directly. All contributions must be referenced from corresponding bugzilla records.</p><h3><a href="#m2eclipse-core-tests-at-github" name="m2eclipse-core-tests-at-github">M2Eclipse Core Tests at Github</a></h3><p>In most cases m2e core patches will require corresponding regression tests. Changes to m2e core tests repository must be submitted as github pull requests and must be linked to bugzilla record, along with corresponding Gerrit change set.</p>
</div>
</div>
</div>
</div><!-- END wrap -->
<div class="stickyFooter">
<div class="footer">
<div class="container">
<div class="row">
<div class="col-md-4 md-margin-bottom-40"></div><!--/col-md-4-->
<div class="col-md-4 md-margin-bottom-40"> </div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
<div class="copyright">
<div class="container">
<div class="row">
<div class="col-md-6">
<p class="copyright-space">
<a href="https://www.eclipse.org/">Home</a> | <a href="https://www.eclipse.org/legal/privacy.php">Privacy Policy</a> | <a href="https://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> | <a href="https://www.eclipse.org/legal/copyright.php">Copyright Agent</a> | <a href="https://www.eclipse.org/legal/">Legal</a> | <a href="https://www.eclipse.org/org/foundation/contact.php">Contact Us</a>
</p>
</div>
<div class="col-md-6" align="right">
<p class="copyright-space">
Copyright &copy;
2016 The Eclipse Foundation. All Rights Reserved.
</p>
</div>
</div>
</div>
</div>
</div>
<!-- JS Global Compulsory -->
<script type="text/javascript" src="/m2e/assets/plugins/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/m2e/assets/plugins/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="/m2e/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/m2e/assets/plugins/hover-dropdown.min.js"></script>
<script type="text/javascript" src="/m2e/assets/plugins/back-to-top.js"></script>
<!-- TESTING JS -->
<script type="text/javascript" src="/m2e/assets/plugins/app.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
App.init();
});
</script>
<!--[if lt IE 9]>
<script src="/m2e/assets/plugins/respond.js"></script>
<![endif]-->
</body>
</html>