RCP build with maven - maven

How to build and package RCP (Rich client Platform) using Eclipse.
Is it possible to build as a .jar file.

I use Maven Tycho. I find it a lot easier to use than the PDE ant scripts.
The itp04 RCP example is a good project to get started.

We use Maven 3 and the sonatype-tycho plugin to build our Eclipse RCP-based application. It allows a plugin-first approach, i.e. you define the dependencies only in the plugin.xml using the editor of Eclipse. You don't have to care about dependencies in the pom.xml as these are managed by tycho.

There are detailed instructions at Apache Felix maven Bundle page on how to do this.
Alternatively, There are some quickstart maven archetypes you could download based on these instructions and experiment with.

I have wrapped PDE/Build by Maven manually. You can find an example in my answer to my own question:
How to set up Eclipse PDE/Build with Indigo?

Related

where does maven tomcat7 plugin stores/reads dependency jars?

I'm trying to override a dependency version through a maven profile. I did a test installing the war and it works. The problem is when I run the war using maven tomcat plugin. I wanted to check which version of the jar is used, but I have no idea where it reads the jars from. I cannot find anything useful on available documentation..
Any help?
I believe this page will help you to understand: http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/adjust-embedded-tomcat-version.html
Use the dependencies section in plugin section
HTH

Maven plugin Tycho -> when to use it and when not to use it

What is the purpose to use Maven Tycho plugins. I read here tycho is used for building eclipse plugins and OSGI bundle.
Questions:- Can not we build eclipse plugins and OSGI bundle just by using the plain old maven POM.xml file[by not using tycho plugin].
What does maven need tycho plugin to help it build eclipse plugin and OSGI bundles?
Why should we use Maven tycho plugin to build eclipse plugins and OSGI bundles?
When using maven (or other command line build tools) manifest.mf) in combination with Eclipse (or another IDE) the classpath ends up being written down twice - once in the pom.xml and once in the Eclipse .classpath (or, for OSGi, in the target platform and manifest.mf). This violates the DRY principle.
There are various solutions to this problem. One is something like m2e, where you use the pom.xml to generate the Eclipse .classpath. Alternatively, you can go in the other direction and start by getting things compiling in Eclipse, and then use a maven plugin to convert that Eclipse setup to a maven build. This is what Tycho does, with the extra wrinkle that it works from a PDE manifest + target platform rather than directly from the .classpath.
Maven doesn't have a built-in packaging type for OSGi bundles and/or Eclipse plugins. So unless you want to use the jar packaging type and manually add OSGi specifics, you need a Maven plug-in to help you with this.
Tycho is one of the plugins that add support for building OSGi bundles.

Installing maven and the maven eclipse plugin?

I installed maven from here: http://maven.apache.org/download.cgi
and also installed plugin for eclipse from the eclipse marketplace.
This is a really dumb question, but what's the difference between the two?
both are same thing ? or for differnet purposes ?
do we need both on system ?
Maven itself is the software you can use on your machine. It has nothing to do with Eclipse. You can use it from the command line with the mvn command to execute Maven goals on your projects in the file system.
The Maven Eclipse plugin (m2e) integrates Maven with Eclipse so you can comfortably use Maven functionality from inside Eclipse rather than using Maven as an external tool. The plugin just integrates Maven with Eclipse and needs a Maven installation to work. You can configure the plugin to use the Maven installation on your system but there is no need for one. It can use it's own internal "installation" of the actual Maven software. This would be basically the same as you can download and install yourself but it is integrated with the plugin. It therefor can't be used outside Eclipse.

Where do I get up-to-date versions of org.eclipse.jdt for Maven?

I would like to use the Eclipse AST to generate source code. My project is managed by Maven and I would like to simply add dependencies for the compiler. Unfortunately, the most recent version I found in central is 3.3.0-v_771. The Tycho project offers newer versions. However, I found that the poms do not specify dependencies and I don't want to do that myself. I've spent quite some time googling for other sources but that's the best I could come up with.
Does anyone know of a better, maven-compliant way of getting JDT in Maven?
You can the use Maven-Eclipse-Plugin to deploy your Eclipse bundles to Maven on your own and then use these. An example command would be:
mvn eclipse:to-maven -DdeployTo=internal-nexus::default::http://myNexus/content/repositories/eclipse -DeclipseDir=C:/Eclipse
Alternatively you could purchase a license for Nexus Pro and provide Eclipse p2-Repositories as Maven repositories.
Now there is an other way. Some of the Eclipse Neon.2 jars are published as normal maven artifacts (pom files are user friendly, the standard dependency management of maven will work).
If you want to use jdt-core in your project you just need to add this:
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.12.2</version>
</dependency>
... and you let maven do the rest for your. I have published a simple example how to use the java code formatter from eclipse in a simple java application.

Integrating JMeter as part of Maven project

I'm starting my work on the project related to creating some custom set of jmeter components that would be bundled in my custom jmeter distribution.
Those custom components are part of the Maven project and what I would like to do is try to integrate this maven project with latest jmeter project to be able to build and deliver jmeter build that contains my custom set of components with all related dependency jars.
Problem is that jmeter project is ant project.
I've came across this: http://maven.apache.org/guides/mini/guide-using-ant.html, maven-antrun-plugin which gives a possibility to embed ant task inside the maven pom.
Since I've never worked with ant (only worked with maven), my idea of using this plugin inside pom would be to define following targets:
download jmeter source from svn repository
build jmeter distribution
after building maven project (after install phase), copy jars (component and dependency jars) to the jmeter lib to form the final jmeter distribution with my custom components.
My question is: Do you find this approach as the right one (are there some things to consider while doing this) and if not, can you suggest me some other ways of achieving the same goal?
Thanks in advance
Since JMeter 2.6, Apache JMeter artifacts are published on maven2 repositories.
See:
http://mvnrepository.com/artifact/org.apache.jmeter/
See for an example :
https://github.com/Ronnie76er/jmeter-maven-plugin/wiki
So what you can do is have your maven project that references these artifacts as dependencies.
And if you want to generate a full bundle containing JMETER+You Plugins then use AntRunner to :
Unzip the official distribution
Copy your artifact in jmeter/lib/ext and dependencies in jmeter/lib
rezip it

Resources