Configuring Development Environment

Checking out code

Check out all the projects in the anonymous svn repository at http://svn.sonatype.org/m2eclipse/trunk into your Eclipse Workspace. You can either do that (1) from the command line and then in Eclipse import them as "Existing projects in Workspace", or (2) with Subclipse using "File / Import... / SVN / Checkout Projects from SVN" wizard or "Checkout..." action from "SVN repositories" view.

See Project Details for more information about m2eclipse projects.

Configuring Target Platform

In order to build and run m2eclipse with Eclipse PDE and with Tycho you need to configure Target Platform that should include required dependencies.

You can assemble Target Platform using Target Definition in the IDE. However it is easier to follow the instructions below or just run predefined scripts that will download all required components (you will need to adjust paths for your environment).

Once you've retrieved all plugins and features for selected target platform, you need to specify their location in "Window / Preferences... / Plug-in Development / Target Platform", using "Browse..." button.

Running m2eclipse in self-hosted mode

Self-hosted mode launches another Eclipse application with references to the development workspace projects, in order to debug plug-ins without installing them. The quickest way to do this is to open org.maven.ide.eclipse/plugin.xml with PDE's Plug-in manifest editor and then on the overview page click "Launch an Eclipse application."

To get more control over what you run, use the menu "Run / Run configurations..." and create a new launch configuration using "Eclipse Application" configuration type. You can select the JRE used, set VM properties, and pick the plug-ins to include (use "all workspace and enabled target plug-ins, or select them individually and use "Validate Plug-ins" action to verify if selected configuration is correct).

You may need to increase Java heap for JVM used to run tests up to 512m. There are two ways to specify this when Eclipse launches Java processes:

  • Add -Xmx512m to the VM Arguments for current target platform: menu Window/Preferences/Plug-in development/Target Platform then select Launching Arguments tab, or you can add those arguments in the target definition editor on Environment tab.
  • Add -Xmx512m to a given launch profile: menu Run/Run Configurations..., select Arguments tab, enter as VM argument.

Running tests

To run all tests from the IDE, select project org.maven.ide.eclipse.tests, right-click, and run "Run As... / JUnit Plug-in test" action from the popup menu. You can use "Debug As... / JUnit Plug-in test" to run tests with debugger. You'll need to set up enough memory as described above.

You can also invoke the same action on individual tests in this project.

One of the tests checks if a J2SE-1.5 execution environment is present, so make sure you have that.

If Target Platform does not specify default JVM memory settings, you may need to specify them in the launch configuration:

-Xmx512m
-XX:MaxPermSize=128m

Updating external dependencies

To update external dependencies you need to enable "update-dependencies" profile when running Maven build for the entire project or individual org.maven.ide.components.* projects:

mvn -Pupdate-dependencies clean package

This will update external jars and also regenerate plug-in's MANIFEST.MF files.

If jar names had been changed, you may have to run "Update the classpath settings" action from the Overview page in plugin.xml editor

Building update site using Tycho

Tycho version 0.2 or above is required to build m2eclipse distribution!

To build complete update site using Maven, you need all projects checked out locally. Then switch to org.maven.ide.eclipse.parent folder and run

mvn clean install

That will build all nested modules, including org.maven.ide.eclipse.update project and if everything succeed, the update site can be found at org.maven.ide.eclipse.update/target/site/

Continuous Integration server is building project update site from trunk and latest build can be downloaded from there.

Generating P2 metadata for update site

The following command from Eclipse 3.4 folder will generate P2 metadata for m2eclipse update site built by Maven:

eclipsec.exe
    -nosplash
    -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator
    -metadataRepositoryName "Maven Integration for Eclipse Update Site"
    -artifactRepositoryName "Maven Integration for Eclipse Artifacts"
    -updateSite C:\dev\m2eclipse-site\update
    -site file:C:/dev/m2eclipse-site/update/site.xml
    -noDefaultIUs -vmargs -Xmx256m
The -updateSite and -site parameters should be pointing to the local folder folder containing update site files build with Maven. Also note that on Windows path specified in the -updateSite parameter should be using backward slashes and URL specified in -site parameter should be using regular slashes.
This step is required after building update site until support for this implemented for the Maven update site build

Publishing dev build

To publish dev build to the update site at http://m2eclipse.sonatype.org/update-dev/

  • Run all tests (have to do that from from the IDE until CI system will be fixed to run them automatically)
  • Build an update site (or download an archive from the CI server)
  • Index update site for P2
  • Verify created update site by installing it from the local update site
  • Create new tag in svn from trunk at https://svn.sonatype.org/m2eclipse/tags/0.9.X.2008MMyy-HHmm, where 0.9.X.2008MMyy-HHmm is corresponding to the qualified version from the build binaries
  • Publish update site
    • Using SVN
      • Checkout the web site from SVN at _https://svn.sonatype.org/m2eclipse/site_
      • In /update-dev/ folder of the checked out project, delete all *.jar files in plugins/ and features/ folders (don't delete the directories, because it would break SVN metadata)
      • Copy new site.xml, content.xml, artifacts.xml and all *.jar files from the locally built update site, e.g. from org.maven.ide.eclipse.update/target/site
      • Commit changes to SVN (don't forget to add newly added *.jar files to SVN)
    • Using WebDAV
  • Try to install dev build from the published update site and do basic smoke testing, create new Maven project, see that it builds, open its pom.xml in the pom editor, etc (ideally do that with clean Eclipse 3.3 and 3.4)
  • Update New and Noteworthy and set the release timestamp from the published build
  • Send announcement to user mailing list and Eclipse news group. Declare main theme for the build. Here is an example.

Publishing release

To publish release update site at http://m2eclipse.sonatype.org/update/

Same as the steps for publishing dev build, except for the following differences:

  • should not need to delete previously published jars (unless there it is a bug fix release replacing the previous one)
  • should also manually merge new plugins and features in site.xml
  • indexing p2 metadata should be done after merging site.xml
  • update site files should go into /update/ folder instead of /update-dev/ folder
    In order to minimize download sizes, we need to figure out process and/or required changes in Tycho that would allow us to not publish unchanged features, i.e. don't change their versions in Maven reactor build

Labels

maven maven Delete
eclipse eclipse Delete
m2eclipse m2eclipse Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.