This is maybe silly question, but I will try to ask anyway :).
It is possible to link compile errors form Maven Console to Eclipse Problems Window ?
I can see errors in the maven console, but the Eclipse Problems view showing no errors, only warnings.
I'm using Spring Source Tool Suite (STS) with M2Eclipse plugin.
My Maven project (for example CarService) consists of 2 modules (server, client). Each of them is separate eclipse project and I don't have imported the parent pom, only the child poms.
Problems window is configured to show all possible errors :).
Thank you for any advice :).
Related
So I am doing major change in a library(maven) which I have developed, and using it in one of the playframework project.
I have finished refactoring changes in maven artifact, published it to repository with new version.
Now I want to see where all this will give errors in play project, so that I can go and fix 100s of such errors. Ideally I would like to use eclipse or some IDE to report me all the errors, so that I can easily navigate and fix.
But problem is that eclipse doesn't know about new library version. To tell that to eclipse I have to upgrade library version in build.sbt, compile and re-create eclipse project. But since it contains many errors, I can not create eclipse project before fixing those.
Is there a way to visualize all those errors in eclipse or any IDE in such cases?
You did not mentioned, if the play project is a maven project as well. I am working with play as a maven project, which is created like this. But I suppose, that with non-maven project the following works as well.
From the command line run:
activator eclipse
In eclipse do 'refresh' to the project. Now you can see all the errors caused by the changes in your jars.
I am new to spring framework and having basic knowledge of maven. I tried to import spring project in eclipse. (File - Import - Existing Maven Projects). I see that,
1) The project is not imported as java project. i.e. if I right click on project and see the properties, I dont see options such as Java build path, Java Compiler etc.
2) I am looking for one particular class in the project, but it is not there, although I can see that class from terminal. Therefore it very much exists in the project. So why cant I see it in Eclipse ? Why is it not imported with the project ?
Please note that I use Eclipse_Juno and I can compile the project with maven on terminal and in eclipse.
There are a couple of things that could have gone wrong. Hard to say what happened.
If the project you have imported builds on the command line (mvn clean install) then chances are good it is importable into an IDE with not much trouble once the settings are ok.
Make sure you have the m2e (maven 2 eclipse) plugin available. So eclipse can detect its a maven project. If you also use spring I would give the Spring Tool Suite (STS) a try: http://spring.io/tools
If the project is not recognized as java - or the essential facets are not detected - I would try to figure out why. Maybe something in the preferences is not properly set up? (maven home, executables, sdk, ...)
I often found myself in a situation where I would like to see exactly which Maven commands Eclipse is running behind the scenes. In this case I am running a webapp with WTP, but this question is more general (though I would gladly accept answers for just that scenario).
Is there any way either with a pom configuration or an Eclipse configuration to view a log of all commands (and potentially any output) that any Eclipse plugin (or at least m2eclipse-wtp) have run?
The Maven Console will show you the Maven output from m2e and m2eclipse - access it from the very right hand side dropdown of the normal Console view.
In Eclipse it is possible to configure builders for a project. I am using m2e and Eclipse indigo for a dynamic web project. I am trying to figure out exactly what happens when I invoke Build for the project from eclipse and so be able to understand the difference between this and a just doing a maven build from the command line. I go to project / builders and see there are five builders: JavaScript Validator, Java Builder, Faceted Project Validation Builder, Maven Prokect Builer and Validation. It would be interesting to see what goals the Maven Project Builder will do but I can't see this from this screen. Edit is disabled. I try Project Properties / Maven and there is nothing to do with Goals there. Even though this http://maven.40175.n5.nabble.com/Preventing-Maven-project-builder-from-being-run-td137622.html suggests there should be.
I am wondering is there any way to see and configure what goals Eclipse will call?
Many thanks.
Strange as it sounds, m2e does not really invoke Maven to do the build.
Its job is to parse POM file and delegate the job of doing everything that it finds there to Eclipse.
It does so by mapping maven plugins to special m2e Eclipse plugins.
Sometimes, when no mapping exists you get a warning and you have a choice of either disabling this part of your build or running the maven plugin in I guess default wrapper provided by m2e. In either case the result is not as good as when a maven-to-eclipse plugin mapping exists
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.