How get Maven war-app fully functional in Eclipse? - eclipse

Any input on how to get Maven war-app fully setup in Eclipse as "Dynamic Web Project"?
We have a webproject setup and working in Maven3.
Using Eclipse-Indigo, latest version, and running
mvn eclipse:eclipse
to import it into Eclipse.
This works fine for the Java-files compilation,
but cannot build a war-file and deploy to an appserver defined in Eclipse.
Would be nice to get that working, too.
(I read that you can use m2eclipse for this, but I sincerely hate it, because (at least some months ago when I last tried it) it's still ridiculously slow to build a reasonably large/complex application -- like it said "Build Project and go have a coffee" in the menu).
I now saw, however, that you can also do
mvn eclipse:eclipse -Dwtpversion=[version]
Problem, according to documentation
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
is that [version] can only be "R7", "1.0", or "1.5".
That seems like awfully old versions...
According to WTP documentation
http://wiki.eclipse.org/WTP_FAQ#What_version_of_Eclipse_does_WTP_work_with.3F
that would require you to downgrade to Eclipse-3.2 from way-back-when...
So anybody has a reasonable solution to this?
Can it also somehow work with recent versions of Eclipse and WTP?

Do not use maven-eclipse-plugin.
Instead use Eclipse's own m2e plugin.
If you follow the link, there is a video that will help you get started.
m2e is officially integrated with WTP and, from my experience, works very well.

Related

Differences in NetBeans and Eclipse for maven projects [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
What are the differences between Netbeans and Eclipse for working with maven projects?
I'm Eclipse user, but to be perfectly honest I have to say that Maven support in Eclipse isn't perfect and often cause weird errors you resolving by cleaning, recompiling, regenerating project files etc.
As far as I know, IDEA and NetBeans have far better support for Maven.
NetBeans has native support for Maven.
What does that mean exactly? It means that if you have a Maven-based project in NetBeans then the pom.xml is what the IDE uses for project definition. The POM is the definition!
Contrast this with Eclipse where Maven support is bolted on top of Eclipse's project definition. This means that any Eclipse solution will have to concentrate on converting to/from Eclipse's own project definition and the POM. I believe this is the root cause of Eclipse's sometimes-less-than-optimal Maven support.
In NetBeans, if your project is Maven-based, then all actions are carried out by Maven. Even the "run" action is effectively done by Maven. The IDE only triggers it. Having this consistency means that you can be sure that your project behaves exactly the same for example if in a non-IDE environment such as a Jenkins/Hudson.
I've met many people who believe that Maven is cumbersome. When you talk some more about it turns out that their bad experience to a large extent comes down to their experience with Maven from within Eclipse, not so much Maven itself. Users of Eclipse tend to think that this is just the way it is supposed to be because they've never seen anything else. (NetBeans users do the same in the opposite direction in the areas where NetBeans is sub-optimal and Eclipse shines)
Let there be no doubt: Eclipse has MANY virtues. Maven support is not one of them.
Starting on an maven based project is much more easier in Netbeans and IDEA than using Eclipse.
in Eclipse, you have to configure your existing project to use maven. Starting by enabling a appropriate maven plugin
using Netbeans and maven is much more easier. Open -> Projekt -> select the pom.xml and you are ready
IDEA has a similar approach. You simply have to import a the project from the existing pom.xml
I have chosen IDEA as my favorite IDE and I'm quite happy with the maven support. Sometimes I have to open NetBeans and at least the maven support works as expected. My own experiences with Eclipse are a little bit outdated but I hear a lot of complaints from my colleagues using Eclipse together with maven.
m2e is the "latest" maven eclipse integration (not to confuse with the old m2eclipse). I really thank all people who spend their time in developing eclipse, maven and m2e - it's my daily work setup, but m2e is far from perfect. Just have a look at the latest "M2E plugin execution not covered" dilemma. If you use non mainstream plugins you have to modify your pom.xml for the m2e usage - just to avoid project errors in eclipse.
To run my mave commands I prefer the command line instead m2e.
As I know Netbeans uses maven more "native" and therefore has not that kind of integration problems. But I am not sure about it. If you have the choice you should compare both possibilities.
I've used both Eclipse and Netbeans. I've used Eclipse more at the university, and professionally it was mixed between Eclipse and Netbeans.
Eclipse is far better than Netbeans depending on the domain.
If you want to work with scala - no other way, eclipse scala plugin is heavily maintained and works much better than Netbeans. If you want to work with perl, same thing.
If you have a massive project with more than 50 large modules and need to do cross cutting refactoring, you are faster with mvn eclipse:eclipse on your root pom, and leting eclipse import and build the project, and then starting with your refactoring.
With that said, when you are doing feature development. And your base project is built in the CI by maven. Oh! Then I can promise you, Netbeans is light years better than eclipse. They are not in the same league when you add maven as the build tool into the equation.
With eclipse, you have to give in and say:
- It is beyond me I let eclipse work as my own built tool and I keep away from the command line. If I even go to a folder and do mvn clean install, eclipse with fight against me.
With netbeans, he just does not try to re-invent the wheel. He lets maven do what maven does, and build your project. It runs your tests with surefire.
In my personal opinion, for Java EE development - namely adding features and "NOT" doing cross cutting massive refactoring and your project is built on maven, Netbeans is by far the best IDE. It is perfect.
It is simplicity in itself. A simple and confortable user interface.
A perfect debugger.
Perfect JSF to bean navication.
Perfect maven integration.
Perfect colaboration with Jrebel.
Netbeans is simple and super effective.
I've found Eclipse to be my enemy, when i want to use maven to run all unit tests or for wahtever reason. If I want to deploy a WAR built by maven ... better not! I need to absolutely give myself into eclipse and let it own everything. I need to keep well away from a command line.

How can I execute Maven goals from Eclipse without M2Eclipse?

I am using the eclipse plugin for maven to generate eclipse projects from maven pom.xml files.
mvn -Dwtpversion=1.5 eclipse:eclipse
This works fine and, after some experimenting with several of the 400 different archetypes available, I settled on using the webapp-javaee6 archetype, which was the only one which generated a set of dependencies that were both all available and which created a project that was useable by the WTP plugin.
The problem now is that I would like to be able to invoke mvn goals from eclipse. The accepted way to do this I understand is to use the m2eclipse plugin, which I have installed.
However, after playing around a bit and getting nowhere I discovered this comment in my .project file:
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
Further searching (see this lengthy diatribe from October) suggests I'm not (just) being stupid in not being able to get this to work.
The how-to linked in the top answer to this question seems hopelessly out of date.
So, the real question - what is currently the correct way to use maven to generate a WTP-friendly project that can be converted to eclipse and then use eclipse to call the project's goals?
Have you tried File -> Import -> Check out existing Maven Projects from SCM? My understanding is that m2eclipse will then create the eclipse project for you. If the packaging defined in the pom is war, the project should be deployable with WTP. (The latter used to require an the maven-wtp-integration plugin as well, don't know whether that's still the case).
Not sure about WTP or maven archetypes, but have you come across SpringSource Tool Suite (Spring packaged eclipse) and created a Spring Roo project? You can use this to create a data driven maven built web-app in a few mins. You can even remove the spring roo bits if you don't want them, it will give you a good starting point for a web-app with very little pain.

STS vs. Eclipse for Grails?

I understand that SpringSource Tool Suite is based on Eclipse.
I am coding Grails. STS is often pissing me off. I was thinking of installing Eclipse instead with a Grails plugin - will it just be the same?
What's better? STS or Eclipse?
Have you considered IntelliJ, it has excellent Grails and Groovy support. I had been a eclipse guy for years but I am loving IntelliJ now.
IntelliJ Grails Features
I believe STS incorporated the original Groovy plugin so you're honestly better off with STS than you are trying to hack together Eclipse with the old plugin.
That said, other IDEs with good Groovy/Grails support are:
IntelliJ IDEA: http://www.jetbrains.com/idea/features/groovy_grails.html
NetBeans: http://netbeans.org/features/groovy/ (but development on Grails support appears to have stopped since 6.8.0)
I've personally tried IntelliJ and I liked it for Grails. I have not tried NetBeans but I've heard it is good.
STS has better Groovy n Grails support. The latest version i.e. 2.5.0 has better features and bug fixes. I would suggest you stick to STS rather than Eclipse. I have been using it for last couple of months and it is very stable. The latest version has much better features and is more stable than previous versions.
I found Eclipse with the Grails plugin easier to configure than STS, so I started out down that route. STS seems overly clunky and too specialized - if your app is anything over than a very vanilla grails app I'd say Eclipse is better.
Having said all of that, I tried IntelliJ IDEA and fell in love with it. I even forked out the $200 for a personal licence when my company said no to buying a license!
STS is an Eclipse distribution packaged by SpringSource, who also own Grails project. You should bring your specific issue to the vendor or at least describe them in your question.
I think you should definitely opt for STS - the integration of the Groovy resp. the Grails plugin is much better than in Eclipse.
On the other hand, the question is hard to answer without getting religious subjective; what are the issues you encoutered in STS and what makes you think they won't occur or even be more annoying in the main Eclipse distribution with no native Groovy/Grails support?
I have been unsuccessful trying to use the Grails plugin on Eclipse. After a lot of work finding the right repositories for missing dependencies, the Grails plugin practically took over Eclipse, it became a quasi STS Eclipse. Even the home window became the STS window!
I guess the producers of STS are basically trying to convince you to switch to STS, instead of using their almost worthless plugin, and going through the pain of getting the plugin working, and getting at the end a STS clone.
You are better off just using STS, but it angers me that people who like Eclipse or MyEclipse have to be forced to use STS' specific version of Eclipse.

Installation of maven eclipse plugin doesn't finish

Hello I'm trying to install maven plugin with eclipse and I have a following problem, more in picture below :
So my question is, is this supposed to take this long or I did something wrong?
I'm using eclipse galileo , I went to the window-> install new software -> typed in
http://m2eclipse.sonatype.org/update/ website and name maven
Pressed next then finish, did I do something wrong, or is there another way to get maven working with eclipse? I need it for my project . thank you
First, update site url you pasted is url for stable version builds. According this document stable version of m2eclipse works with Eclipse 3.2, 3.3 or 3.4.
To work with Galileo version (Eclipse 3.5) try update from stable development builds site. I work with this version and I'm happy with it. It has a lot more features than stable one.
You could use maven-eclipse-plugin instead of m2eclipse.
With maven-eclipse-plugin you just add some configuration to pom.xml, execute mvn eclipse:eclipse and refresh project in Eclipse and you are done.
You will lose UI to handle dependencies etc. directly from IDE (that would be provided by m2eclipse) but I have not seen much benefit from that. You can manually edit pom.xml just fine.

Maven2 Eclipse integration

There seem to be two rival Eclipse plugins for integrating with Maven:
m2Eclipse
and
q4e.
Has anyone recently evaluated or used these plugins?
Why would I choose one or the other?
Side by side comparison table of three maven plugins.
There is only one point where q4e is actually better: dependency viewer. You could see the dependency tree, manage your dependencies visually and even see them in a graph. But, m2eclipse works in a better way, specially because you can create you own build commands (in the run menu). q4e comes with some predefined commands and I can't find where to define a new one. In other words, m2eclipse is more friendly to the maven way.
I have been using m2Eclipse for quiet some time now and have found it to be very reliable. I wasn't aware of q4e until I saw this question so I can't recommend one over the other.
My 2cents,
I am using eclipse for some months now with m2eclipse integration. It's easy to use and straight forward. Once you associate your project to maven and update the dependencies using m2eclipse, any change to pom.xml are reflected to entire project, even Java version definition causes it to be compiled in right JRE (if you have it installed, and properly configured into eclipse.)
Another advantage I found is the maven plug-ins are easy to use integrated with eclipse (jetty being my best example, again, properly configured you can easily integrate maven, jetty-plug-in and Eclipse Debugger)
Compilation, packaging and all other maven features are equally easy to use with a couple clicks or shortcuts.
About q4e I have been reading a lot of good stuff about it and seems the next versions will do a lot more than m2eclipse, with a better dependency management and even visual graphs (!) but the general opinion is that m2eclipse is still better than q4e but q4e is getting better each new version and maybe will surpass m2eclipse soon.