How to create new Eclipse RCP project using Maven (preferably m2eclipse)?
I read that there's plug-in for Maven that have idea about Eclipse.
(Maven Eclipse Plugin) And then it looks like I need to find some Maven Archetype to create Eclipse RCP project, but I could not. At this point I am in doubt if I go right way.
I just want to use maven dependencies resolution and other features in my RCP application development.
P.S. I found that it is possible to "Enable Dependency Management" via m2eclipse.
The other option is to make 2 project: maven project and Eclipse RCP project that will reference the first on classpath. What is the smart way?
P.P.S There's also option to use Eclipse dependency resolution mentioned here
Convert your library project to a
plug-in project (right-click ->
Configure -> Convert to Plug-in
Project) and add it to the
dependencies of your plug-in project
(manifest editor, Dependencies tab).
Maybe Tycho (http://tycho.sonatype.org/) will help you. Currently, it seems to be a little bit alpha, but after releasing Maven 3.0, Jason van Zyl promised to spend more time on Tycho (http://www.sonatype.com/people/2010/10/maven-3-0-has-landed/).
Pending all the maven3 magic highlighted in Steve's answer, you do have this Maven RCP build recipe, based on the pde-maven-plugin (as presented in the Eclipse Plugin Development Environment support page)
Related
I already have a project in IntelliJ IDEA based on SBT. It works fine, compile and run. Now I want to add the Maven support as well.
How is it possible in IntelliJ IDEA having support for both build managers SBT and Maven in the same project and switch between them ?
In my experience you should have either maven or sbt enabled. Never both.
The solution:
checkout project from repository to project_sbt directory
open project in intellij as sbt project (just open project_sbt/build.sbt from disk)
checkout the same project from repository project to project_maven directory.
open project in intellij as maven project (just open project_maven/pom.xml from disk)
Disadvantages of this solution:
Changes in sbt project are not visible immediately in maven project (and vice versa)
You have to maintenance two build systems (special plugins)
I have installed maven and eclipse juno, on CentOS. Can anyone guide me how to integrate Eclipse with maven. I am going to use this configuration for Mahout.
You need to install a plugin for eclipse so that it knows what to do about maven projects (such as m2eclipse).
Once you have that installed, you can configure it (Windows -> Preferences -> Maven) to point to your existing maven installation, and can then create maven projects via the New -> Maven Project wizard.
You can also convert existing project to maven projects via a right click -> Configure -> Convert to Maven Project.
You can download maven from from eclipse market place
Simply go to help -> eclipse market place, then search maven.
(Though i have always got it already integrated in eclipse).
After you can make various customizations to suite your needs by selecting, window -> preferences, then type in maven in the search bar ontop, you can configure the location of your settings.xml file, maven installation to use and other things you may want.
Hope this helps.
If i want to convert an EAR project a maven project , do i need to add the module in the deployment assembly as maven dependency or just use the convert in m2eclipse without any further configuration.
Me personally I wouldn't attempt any kind of conversion of an existing project. I would add the poms, make sure that mvn clean install works on the command prompt and then create a new mavenized Eclipse project from the poms.
The main reason is that you current project settings are effectively wrong when you switch to Maven - the Maven poms are the truth and what feeds the Eclipse project setup, so you really do not want to make your life difficult and work against m2eclipse - let it do the project creation for you. Fresh.
You can install m2eclipse and then do the following as well.
Go to the project menu (right click on Package Explorer) > Configure > Convert to Maven Project
Open the pom.xml and right-click and choose Run As -> Maven Clean. Similarly Choose Run As -> Maven Install.
Note : Please ensure that your eclipse project settings are correct and classpath libraries are not absolute and you don't have any project specific environment variables defined in your workspace. Please take a backup of your project before you do this.This is to ensure we don't mess up the current stable project configurations. Once m2eclipse generates the pom.xml for your project, you can update and make changes to it to
fully obtain a mavenized ear build. hope this helps
You can also try creating new maven project with archetype selection of "jboss-javaee6-ear" and follow the similar structure for your project. Most probably you will need parent Pom and child poms per each module (ejb, war, jar etc). There are other few similar approach but almost all of them requires you to have mulitple POMs
maven-ear-plugin and JBoss AS 7
You can also go through all the examples for maven ear plugin to find settings suitable for you
http://maven.apache.org/plugins/maven-ear-plugin/
I ended up ditching ear for war :) single POM and even ditched the JBOss for tomcat/jetty :)
If you want to convert your existing eclipse dependencies into Maven dependencies, you can try the JBoss Tools (JBT) Maven integration feature, which contains an experimental conversion wizard, plugged into m2e's conversion process : http://docs.jboss.org/tools/whatsnew/maven/maven-news-4.0.0.Beta1.html.
So, all you have to do is, as Keerthi explained, right-click on your project and Configure > Convert to Maven...
If your dependencies already are maven artifacts, it should work easily. If not, you'll need to convert them to Maven (if they're workspace projects) or make them available in your maven enterprise repository, before converting the EAR project.
JBT (requires Eclipse JavaEE) can be installed from http://download.jboss.org/jbosstools/updates/stable/kepler/ or from the Eclipse Marketplace (See https://marketplace.eclipse.org/search/site/jboss%2520tools)
I've been doing some research on adding Maven to an existing Android project and I'm struggling to see how this works. I've used Maven once at work on a web based project with Netbeans, but for this project I'm looking to use IntelliJ. I can create a new "Maven Module", but I already have an Android project so I'm not entirely sure that's the route I should be taking.
I found this post which does provide some detail, but not a step-by-step windows integration guide (at least that I'm seeing).
Is it possible for me to use Maven within an Android project?
Edit: I'm looking to do this within a Windows environment
To answer your question in the last sentence: Yes, you can use Maven to build an Android project.
You should use the maven-android-plugin in your Maven project. The best place to get started is https://code.google.com/p/maven-android-plugin/wiki/GettingStarted. Need to read up a bit, but definitely worth the effort.
If I have existing IDE specific Android project that you would like to switch to Maven, instead of trying to "add Maven support to an existing IntelliJ project", I would:
Create a new Maven based project using an appropriate archetype https://github.com/akquinet/android-archetypes
Copy existing source/resources to the Maven project directories.
If done correctly, you can open this (Android) Maven project (pom.xml) in IntelliJ and use it like an Android project (including GUI editor). IntelliJ automatically generates an IntelliJ project from Maven's pom.xml and detects the Android facet.
This way, your project also stays IDE agnostic - you can do everything (build/test/deploy) from command line as well - how Maven projects should be IMHO. :D
I have an existing Dynamic Web Project in Eclipse Indigo and the m2e plugin installed. In another version of my eclipse setup that I dont quite remember (my hdd crashed) I could just right click on the project -> Maven -> Enable Dependency Management.
This menu is gone for my Dynamic Web Project in my current eclipse version. Whats the way to go now? I tried right click on the project folder -> configure -> convert to maven project but that fails with errors.
M2Eclipse has migrated to an Eclipse project from Sonatype called m2e. Therefore in you Eclipse Indigo you have installed m2e whereas your old Maven projects in the older Eclipse version were created with M2Eclipse according to your right-click description. Now under normal circomstances everything should be working flawlessly and we wouldn't have this discussion. Unfortunately with the move of the project the namespace has changed from org.maven.ide.eclipse to org.eclipse.m2e.core and old Maven projects created with M2Eclipse are not immediately recognised as Maven projects in m2e. Here's a description of how to migrate your projects accordingly.
Erik, importing an existing maven project would let m2e discover and propose you to install m2e-wtp, the Maven Integration for Eclipse WTP plugin. Since you're starting from scratch, you should install m2e-wtp yourself (see https://github.com/sonatype/m2eclipse-wtp/wiki).
Now in order to quickstart a new mavenized web project, you should go to the "New Project" menu and choose new Maven project.
At this point, either you choose to create a "simple" project, in which case you need to select the "war" packaging on the following screen, or use a maven archetype, which will quickstart a new preconfigured web project, with the flavor you want (jsf, spring ...). The m2e-wtp wiki has links to help you get started.
Note : at this point Eclipse to Maven conversion is pretty much inexistant (only creates a bare pom.xml), that's why I recommend to create a maven project first. Hopefully, this should get better in the next m2e 1.1 (June 2012)