Michael Mühlebach wrote:
The client is an Eclipse RCP application built on version 3.3.1 which has several plugins. Here are my fist difficulties: Is the client one project in maven or a multi module project which has for each plugin a project like it is in eclipse itself?
To help you understand how to solve this, you need to know what the two main maven plugins that may help you, do. Once we figured this out, it made things significantly easier.
First, the maven-eclipse-plugin. The purpose of this plugin is to synchronise information (mainly dependencies) from the maven world, into the eclipse world, and that is it.
To do this, the maven-eclipse-plugin either creates or modifies the .classpath, .project and MANIFEST.MF files in your Eclipse plugin project, with various details that maven knows.
The maven-eclipse-plugin doesn't have any knowledge on how to build anything, its job ends at synchronising the configs between the two.
The second, the pde-maven-plugin, allows you to trigger an Eclipse PDE build from within maven, and deploy the resulting build into the maven repository.
This second part is important to understand: The pde-maven-plugin simply wraps the Eclipse PDE build system so that it can be started off by maven, and again, doesn't do anything more.
The key secret behind getting this to work, is to create a working Eclipse PDE build, and one this works - to wrap this build in pde-maven-plugin so maven can kick it off.
Some things you will need to do to get this to work:- Your directory structure and project layout will be dictated to you by Eclipse PDE. Maven will have to conform to whatever directory layout Eclipse wants, not the other way around.
What Eclipse typically wants is a directory called "plugins", and each plugin underneath this directory. We set up a multi-module maven config, with a root pom in the same directory as "plugins", and including submodule poms in each plugin directory, like this:
pom.xml plugins/ plugins/com.example.plugin1/ plugins/com.example.plugin1/pom.xml plugins/com.example.plugin2/ plugins/com.example.plugin2/pom.xml- If your plugins depend on plain-old-java-objects or EJBs (as is typical in a client server environment), then there is more fun.
If you use EJB3 and simple interfaces, you may be able to create an Eclipse plugin containing your EJB interface, that is both an eclipse plugin, and an EJB. Because it is a plugin, Eclipse sees it using the standard eclipse mechanism, and because it is an EJB deployed in a maven repository, your client/server backend can use the same jar file and not care that eclipse is involved.
The second way to do this, which if you don't have a clean interface between the Eclipse RCP stuff and the server, is to make your eclipse plugin depend directly on the jars you need by specifying them in the plugin pom, described here:
http://maven.apache.org/plugins/maven-eclipse-plugin/pde.html Regards, Graham --
smime.p7s
Description: S/MIME Cryptographic Signature
