Maven not displaying in Eclipse - eclipse

Recently i have installed m2e maven container plugin in eclipse. After installing, i couldn't see Maven dependencies and maven options. when i select pom.xml and right click, there is no maven run option. i got XSL Transformation...how to remove this? I wnat to use maven targets . Also i couldn't select the existing maven project from source as there is no maven option is displaying.. please help me to fix this.

You can try to do right click on Project > Configure > Convert to Maven Project
After of that you will see maven options under Run As menu...
Or from your terminal you can try to convert you project:
cd ~/workspace/myProject/
mvn eclipse:eclipse

Related

Create Maven Project in Command Line VS in Eclipse

I read in some tutorial , we can create Maven project in command line by
mvn archetype:generate
and then mvn eclipse:eclipse
and then Go to Eclipse and Import Existing Maven Project
Alternatively, I also see that we can create Maven project directly from Eclipse
In Eclipse : File - New - Maven Project ... Done
My questions
Why we need to create Maven project from command line if we can create it directly in Eclipse ?
Do we need to download Maven from here to create and use Maven project? I see Eclipse Neon 2 can create Maven project without downloading those jars.
Thank You.

How to run maven project in eclipse

I have maven project on Java with TestNG. I want to run it from eclipse. I use Eclipse Kepler and have installed m2eclipse plugin. But there is no any option connected with maven in menu Run as... Could someone help me with such issue. How should I run maven project in eclipse?
To build a maven project in eclipse
In Eclipse, Run -> Run Configuration
Right click on Maven and select New
Enter Name, select base directory of your maven project
Enter Goal as "clean install"(or yours options)
Click on Apply and Run
There are some possible changes are there for build failure because of tool.jar not found and Reference here

How to add Maven dependencies in Eclipse libaries

Can any one explain how to add Maven dependency JAR i.e. build path libraries? To be very specific how to include JAR file mentioned in pom.xml to Java build path? Maven dependencies - unable to see jars over here.
Don't have a option to update Maven dependencies. Also executed the script mvn eclipse:eclipse, seen on StackOverflow.
Generally, you should not have any need to deal with such a task manually. Here is the correct procedure for importing of maven project to your Eclipse IDE:
Make sure you have m2eclipse plugin installed (Maven support for Eclipse). As far I remember it is included to Eclipse IDE for JEE developers by default.
Checkout your maven project to any directory
From this directory (root pom.xml is located in), run: mvn eclipse:eclipse
Go to Eclipse, File -> Import, select "Existing maven project"
Select directory where your root pom.xml is located, Eclipse should find all maven modules.
Optional: if eclipse will tell you that it can't recognize some maven plugins - ignore this, just continue.
If you follow this instruction, IDE will create all maven modules as eclipse projects and you will have an option to update maven dependencies and also willsee all of them rigth in IDE.

Maven plugin with eclipse

I am trying to assemble Maven plugin with eclipse. For that I have already installed the m2eclipse. Now, in the new project, I have created a new Maven project.
When I try to run it by right clicking to the application, there are several options available.
When I run as Maven build, it gives build faliure but if I run as any other option such as maven install or maven clean or maven test, it gives build success.
Why so ?
On right click, when you do maven build, enter the command clean install and then try.

Error while running a hibernate program in eclipse

I was trying to run a hibernate sample in eclipse and I am getting
Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig.classpathProvider
I just uninstalled maven from eclipse but I think I need to make some changes in configuration to make my program work now.
Thanks,
Sid
If you are no longer using maven eclipse plugin, then you should regenerate your eclipse configuration with
mvn eclipse:clean eclipse:eclipse
This will make available all the project dependencies to eclipse.
I just had this problem from some old maven settings; it was stuck between maven nature and default.
You can right click the project -> Configure -> Convert to Maven Project. Now that you have the maven option you can do right click project -> Maven -> Disable Maven Nature.
This got it unstuck for me, but you could also manually fix it in the .classpath file.
You need to clean your workspace. Projects -> Clean...