configure-eclipse

There are multiple approaches to using Maven projects within Eclipse. If you use an approach that isn't listed here, feel free to add it.

Use Maven to generate Eclipse project files

  1. First, build scm-manager from source.
  2. Open a shell to the root of your scm-manager source.
  3. Run the following command:
    mvn eclipse:configure-workspace -Declipse.workspace=YOUR_WORKSPACE_PATH
  4. Run the following command:
    mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
  5. Open Eclipse using the specified workspace.
  6. In Eclipse, select the "File", "Import..." menu.
  7. Select the "General", "Existing Projects into Workspace" item and click "Next".
  8. Click "Browse" and select the root of your scm-manager source.
  9. All projects will be selected by default. Click "Finish".

Troubleshooting

You may encounter an error during the "eclipse:eclipse" step that looks like this:

[INFO] Request to merge when 'filtering' is not identical. Original=resource src
/main/resources: output=target/classes, include=[META-INF/scm/plugin.xml], exclu
de=[**/*.java], test=false, filtering=true, merging with=resource src/main/resou
rces: output=target/classes, include=[], exclude=[META-INF/scm/plugin.xml|**/*.j
ava], test=false, filtering=false

This error is caused by a bug in version 2.7 and 2.8 of the Maven eclipse plugin. See below for one workaround. Other discussion of this issue can be found here.

  1. Add the following line within the <settings> element of your /.m2/settings.xml file:
    <usePluginRegistry>true</usePluginRegistry>
  2. Add the file /.m2/plugin-registry.xml with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<pluginRegistry
  xsi:schemaLocation="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0 http://maven.apache.org/xsd/plugin-registry-1.0.0.xsd"
  xmlns="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-eclipse-plugin</artifactId>
      <useVersion>2.6</useVersion>
      <rejectedVersions>
        <rejectedVersion>2.7</rejectedVersion>
        <rejectedVersion>2.8</rejectedVersion>
      </rejectedVersions>
    </plugin>
  </plugins>
</pluginRegistry>

If you have .project files in any parent directory, the Eclipse import step will not search beneath that parent for any further projects. Delete the .project file in the parent and try the import again.

If you get errors in Eclipse about not finding M2_REPO, it means that the eclipse:configure-workspace step didn't work. One cause for this could be using "" or other special characters in your workspace path that the plugin doesn't resolve properly. Either re-run eclipse:configure-workspace, or manually create a classpath variable named M2_REPO pointing to the root of your local maven repository directory.

If you get compilation errors on JAXB or ServiceLoader, your Eclipse may not be configured to use Java 6.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.