Continue development of Plugin
Asked Answered
U

2

10

There is an Eclipse Plugin managed by Maven containing this configuration:

<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>wonttellya</groupId>
        <artifactId>wonttellya</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>jar</packaging>
        <dependencies>
            ...
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.10</version>
                <configuration>
                    <pde>true</pde>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

In console I run

C:\Users\user\git\wonttellya\mvn 
         eclipse:eclipse -Declipse.workspace=C:\Users\user\workspace2
...
Using Eclipse Workspace: C:\Users\user\workspace2    
...
BUILD SUCCESS

If I open Eclipse in the workspace there is no project.

Ubiquitous answered 3/11, 2015 at 7:15 Comment(3)
The intention of the maven-eclipse-plugin is to create/change/upgrade the eclipse configuration from command line etc. It is usually not needed in the pom to be configured.Rambouillet
@Rambouillet maven.apache.org/plugins/maven-eclipse-plugin/pde.html told me to configure itUbiquitous
Ah ok...wasn't aware of that.Rambouillet
T
4

First of all, you have to understand that the purpose of the maven-eclipse-plugin is, quoting its documentation:

to generate Eclipse IDE files (*.classpath, *.project, *.wtpmodules and the .settings folder) for use with a project.

Its goal is not to create an entire project but the building Eclipse blocks from an existing project.

This is also true for PDE support. Quoting its documentation:

Note that the scope of the maven-eclipse-plugin is to synchronise the Eclipse .project and .classpath files with the configuration found in the pom file. Once you have finished configuring the Eclipse plugin as below, and once you have run the eclipse:eclipse goal, you will be in a position to build your plugin code with the Eclipse IDE, or the Eclipse headless PDE build. The Eclipse headless PDE build can be triggered from within Maven using the pde-maven-plugin.

As such, the configuration you have simply enables the creation of correct .project and .classpath files for an existing project, nothing more. Once this configuration has been made and eclipse:eclipse goal was run, you will need to follow these steps:

  • Open Eclipse and import the existing project, by going to "File > Import... > Existing Projects into Workspace".
  • Right-click the new project and select "Configure > Convert to Plugins Projects...". Confirm this choice.

You will then be able to build your Eclipse plugin directly in the IDE.

Note that I do not recommend using this solution and I would suggest you use Tycho instead, this might be an improvement you could make to this plugin (refer to this question).

Tatty answered 6/11, 2015 at 10:57 Comment(6)
Please note that the Maven Eclipse Plugin is deprecated in favor of m2e and will be removed from the ASF.Kimsey
@Kimsey Yes, m2e should definitely be prefered over Maven Eclipse Plugin. Official JIRA about the retirement of this plugin: MECLIPSE-763.Tatty
I did that but the project is not marked as "Eclipse Plugin".Ubiquitous
@PeterRader What do you mean? What did you do?Tatty
I "just open eclipse and import the existing project, by going ...". The project is imported but its not a PDE-Project. What sense does the <pde> in the pom.xml make?Ubiquitous
@PeterRader See my edit, forgot to add that you need to convert it to a Plugins project.Tatty
T
1

Make sure you have update your project before you run the maven install Try to click on your project with the right mouse button and go to maven-->update project

For a different clause You can use export and import with archive (.zip) that you can manage Plugin and simply transfert your project in different workspaces

Thermostatics answered 12/11, 2015 at 21:14 Comment(1)
The task of eclipse:eclipse is :**Generates the following eclipse configuration files:...**. If the project already visible in the workspace, the configuration-files already exists and i do not need to call eclipse:eclipse.Ubiquitous

© 2022 - 2024 — McMap. All rights reserved.