How to build an Eclipse plugin with Maven/Tycho for use in the "Install New Software" dialog

1.6k views Asked by At

I want to automate Eclipse plugin builds with Jenkins. For this I am using the Tycho Maven plugin. The plugin build works fine, but I am not able to install it through Install New Software... option in Eclipse. I have to manually deploy this plugin with the Export option.

Is there a way to automate this task? I've created another project, a Feature Project, and I build it with Maven. Packaging is eclipse-feature. However, the output directory structure doesn't resemble one that is created while doing Export.

Here is the pom.xm of my plugin:

<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<repositories>
    <repository>
      <id>luna</id>
      <url>http://download.eclipse.org/releases/luna</url>
      <layout>p2</layout>
    </repository>
</repositories>

<modelVersion>4.0.0</modelVersion>
<groupId>com.acme.viewer</groupId>
<artifactId>ViewerPlugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>0.23.0</version>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>
</project>

And here is the pom.xml of my the feature:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ViewerPlugin.Feature</groupId>
  <artifactId>ViewerPlugin.Feature</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>eclipse-feature</packaging>

  <repositories>
    <repository>
      <id>luna</id>
      <url>http://download.eclipse.org/releases/luna</url>
      <layout>p2</layout>
    </repository>
  </repositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>0.23.0</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
</project>
1

There are 1 answers

0
Chandrayya G K On

Install New Software... expects eclipse repository structure.

You need to create update site project and use packaging as eclipse-repository

Check the tycho packaging types here