Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

How To

Import a pom-only project into Eclipse

'mvn eclipse:eclipse' won't generate .project and .classpath for a pom-only project.

Change the packaging to jar temporarily, run mvn eclipse:eclipse and then revert changes.

Then you can File -> Import -> Existing projects into workspace and Eclipse will recognize it.

Build an internal repository containing the plugins from an Eclipse installation

Note: Running this command from a complete Callisto install can take some time (in the order of hours), thankfully it is a once off.

This will create pom's for all the plugins from your Eclipse installation located at
/path/to/eclipse/install and deploy them to your internal repository external_free

No Format
mvn eclipse:make-artifacts \
  -DeclipseDir=/path/to/eclipse/install \
  -DdeployTo=external_free::default::scp://NUCLEUS/usr/local/www/default/maven2_repositories/external_free

The created pom.xml will also have dependencies on any plugins they require.

Add the Eclipse RCP artifacts to your internal repository

This will add the Eclipse RCP artifacts which you have downloaded and install them into your internal repository external_free so they can be shared. These files need to be deployed to a maven repository so that they can be referenced in your pom as dependencies. e.g. #Create an Eclipse RCP Target will only be able to automate the creation if they are available in a maven repository.

Upload the eclipse-RCP-3.2-win32.zip

No Format
mvn deploy:deploy-file \
  -DrepositoryId=external_free \
  -Durl=scp://NUCLEUS/usr/local/www/default/maven2_repositories/external_free \
  -DgeneratePom=true \
  -Dpackaging=zip \
  -DgroupId=org.eclipse \
  -DartifactId=eclipse-RCP \
  -Dversion=3.2 \
  -Dclassifier=win32 \
  -Dfile=eclipse-RCP-3.2-win32.zip

Upload the eclipse-RCP-3.2-delta-pack.zip

No Format
mvn deploy:deploy-file \
  -DrepositoryId=external_free \
  -Durl=scp://NUCLEUS/usr/local/www/default/maven2_repositories/external_free \
  -DgeneratePom=true \
  -Dpackaging=zip \
  -DgroupId=org.eclipse \
  -DartifactId=eclipse-RCP \
  -Dversion=3.2 \
  -Dclassifier=delta-pack \
  -Dfile=eclipse-RCP-3.2-delta-pack.zip

Create an Eclipse RCP Target

Follow the instructions below to configure your pom.xml. Then to create the Eclipse RCP target use mvn validate

Unpack the Eclipse RCP platform, delta pack and install any plugins that you need

No Format
  <build>
    <plugins>
      <plugin>
        <!-- Unpack the Eclipse RCP platform and delta pack -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>create-eclipse-target</id>
            <phase>validate</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.eclipse</groupId>
                  <artifactId>eclipse-RCP</artifactId>
                  <version>3.2</version>
                  <classifier>win32</classifier>
                  <type>zip</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse</groupId>
                  <artifactId>eclipse-RCP</artifactId>
                  <version>3.2</version>
                  <classifier>delta-pack</classifier>
                  <type>zip</type>
                </artifactItem>
              </artifactItems>
              <outputDirectory>
                ${project.build.directory}
              </outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
      	<!-- Install all plugins that are dependencies of this pom -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.3-INTERNAL-r489210</version>
        <executions>
          <execution>
            <id>install-plugins</id>
            <phase>validate</phase>
            <goals>
              <goal>install-plugins</goal>
            </goals>
            <configuration>
              <eclipseDir>target/eclipse</eclipseDir>
            </configuration>
          </execution>
        </executions>
      </plugin>

Define as dependencies any plugins needed in the target platform

Add each plugin needed to be in the target platform as a dependency in the pom.xml file.

For example, suppose that org.eclipse.update.core_3.2.0.v20060605.jar needs to be included, then:

No Format
  <dependencies>
    <dependency>
      <groupId>org.eclipse.update</groupId>
      <artifactId>org.eclipse.update.core</artifactId>
      <version>3.2.0</version>
    </dependency>
  </dependencies>

This will also download all transitive dependent plugins.

Build your Eclipse Plugin

As far as I know the maven-eclipse-plugin can't help you to build your Eclipse plugin.

There is some work going on with OSGi bundles being built, some discussions with the Eclipse team to expose and unify classpath and PDE features to make it easier to externally tool plugin development.

However you can use the pde-maven-plugin@codehaus to build your plugins with Maven. pde-maven-plugin invokes the Ant pde build files to actually do the work. You can even create an RCP application this way.