I am in Eclipse Indigo and I have installed m2eclipse plugin. I saw in Eclipse Helios there is an option Maven in the right click menu, when I clicked on a Project, but this option is not present now.
I have installed Maven from both of the marketplace and also from adding site in Install new software option in Eclipse(Help->Install New Software).
What I am doing wrong.
This question was asked before in SO, but I tried the solution provided there.
Is this option is really not present? What I want is to enable Maven Dependency Management of a Dynamic Web Project of Eclipse.
You have to do a right click on the project, then choose Configure → Convert to Maven project
Right Click on the Project --> Configure --> Convert to Maven Project.
It will show Maven Related Options.
One way is to import the project as Maven project.
If you are trying to install in Eclipse older versions, use YOXOS Marketplace - by EclipseSource. Search for "Maven" in marketplace. You will get Maven Integration for Eclipse provided by Sonatype. Use that to install.
After installing m2eclipse plugin, go to Window -> Preferences. Check "Maven" is enlisted at the left panel list
this happened to me because I imported a parent folder as a project. so all my projects where sub directories of this parent folder and not a project them selves. after deleting them (only) from the workspace and re importing them as separate projects, maven worked fine.
Related
I have the newest IntelliJ, and the create Maven project button is gone. I also cant find it in any of the lists.
See the intellij menu
You can see the difference here, in IntelliJ's Getting Started with Maven page:
https://www.jetbrains.com/help/idea/2016.1/getting-started-with-maven.html
Anyone know how to get it back?
I want it because then you get the structure, and the pom.xml file automatically.
You need to install the Maven plugin.
Go to Plugins (in IntelliJ; press shift-shift, and search for "plugins"). In Plugins window, search for Maven and install the Maven Plugins.
You can create java project and later right click on your project -> add framework support -> choose maven.
I am learning building a Java project in Eclipse using Maven. I created a Java project HelloWorld from
“maven-archetype-quickstart” template in a folder D:/maven_projects. Then to convert the Maven project to support Eclipse IDE, I navigated into the project folder and issued the commands:
mvn eclipse:eclipse and mvn package .
Then I imported the project in Eclipse and did the necessary Eclipse configurations like setting the Maven local repository in Eclipse classpath. Now the project in D:/EclipseWorkspace folder. I ran the project successfully in Eclipse printing "helloworld".
Now if I want to go on develop the project and for that reason want to add new dependencies in pom.xml in Eclipse, then the new jars are not added in classpath when I run the project.
So my question is after importing a Maven project into Eclipse how can I add more and more dependencies in pom.xml, then build and run the project? What is the recommended and efficient way to do this?
I would recommend you don't use the m2eclipse command line tools (i.e. mvn eclipse:eclipse) and instead use the built-in Maven support, known as m2e.
Delete your project from Eclipse, then run mvn eclipse:clean on your project to remove the m2eclipse project data. Finally, with a modern version of Eclipse, just do "Import > Maven > Existing project into workspace..." and select your pom.xml.
M2e will automatically manage your dependencies and download them as required. It also supports Maven builds through a new "Run as Maven build..." interface. It's rather nifty.
1.Update project
Right Click on your project maven > update project
2.Build project
Right Click on your project again. run as > Maven build
If you have not created a “Run configuration” yet, it will open a new configuration with some auto filled values.
You can change the name. "Base directory" will be a auto filled value for you. Keep it as it is. Give maven command to ”Goals” fields.
i.e, “clean install” for building purpose
Click apply
Click run.
3.Run project on tomcat
Right Click on your project again. run as > Run-Configuration.
It will open Run-Configuration window for you.
Right Click on “Maven Build” from the right side column and Select “New”.
It will open a blank configuration for you.
Change the name as you want. For the base directory field you can choose values using 3 buttons(workspace,FileSystem,Variables). You can also copy and paste the auto generated value from previously created Run-configuration. Give the Goals as “tomcat:run”. Click apply. Click run.
If you want to get more clear idea with snapshots use the following link.
Build and Run Maven project in Eclipse
(I hope this answer will help someone come after the topic of the question)
Dependencies can be updated by using "Maven --> Update Project.." in Eclipse using m2e plugin, after pom.xml file modification.
Just install the m2e plugin for Eclipse. Then a new command in Eclipse's Import statement will be added called "Import existing maven projects".
answer 1
Right click on your project in eclipse
go to maven -> Update Project
answer 2
simply press Alt+F5
after updating your pom.xml. This will build your project again and download all jar files
Right Click on your project
Go to Maven>Update Project
Check the Force Update of Snapshots/Releases Checkbox
Click Ok
That's all. You can see progression of build in left below corner.
When you add dependency in pom.xml , do a maven clean , and then maven build , it will add the jars into you project.
You can search dependency artifacts at http://mvnrepository.com/
And if it doesn't add jars it should give you errors which will mean that it is not able to fetch the jar, that could be due to broken repository or connection problems.
Well sometimes if it is one or two jars, better download them and add to build path , but with a lot of dependencies use maven.
If you are getting this error :in cucumber Exception
Cucumber Exception: java.lang.ClassNotFoundException:
cucumber.io.ResourceLoader :
then add following jar file to your pom.xml
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.1.8</version>
</dependency>
Run the maven build once and should be gone
I checked out a maven project and imported to my Eclipse (Indigo) with maven integration via the m2eclipse plugin. I configured the project as a maven project. When I r click on my project and click Run As... I'm able to see all the maven configurations (maven build, maven clean, maven install etc.) The project icon has an m indicating that it's a maven project. When I r click an go to Maven I'm able to see
Add Dependency
Add Plugin
New Maven
Download Javadoc
Download Sources
Update Project
Disable Workspace Resolution
Disable Maven Nature
-I was told that I'd be able to see 'Update Dependencies' under the Maven menu but it seems to be missing. Is this to be expected given my Eclipse version or something? Or do I have to configure the project in some way to get 'Update Dependencies' to show up under the Maven menu?
Are you able to see the option "Convert to Maven Project" under the "Configure" menu?
This answer is based on m2e in Eclipse Helios, I haven't tried it in later Eclipse versions yet.
On the latest m2e version I installed today, I've found I need to go to Maven / Update Project... in the context menu, then select the options you want. (The Update Dependencies option seems to be fixed in the "on" position on mine.)
It may be that the current version can still be configured to show the menus as they used to be; I don't know. I say this because my old version was of a later date than the original post here, but still had the Update Deps and Update Project Conf options in the Maven menu.
I installed maven on eclipse, its working when I go to the project and do do maven clean, then maven install. But if I go the project and try to go to Configure then as maven project, the option does not appear in my eclipse but in my friends eclipse it appears.
Eclipse is designed to run completely stand-alone, so for a quick fix you could just copy over your friend's eclipse folder to your own machine and see if the option appears.
For the long fix, how about reinstalling the maven eclipse plugin software?
http://maven.apache.org/eclipse-plugin.html
I have a multi-modules Maven project checked out from SVN. I installed m2eclipse in Eclipse. Then I imported the project into Eclipse. Everything is fine. But after I update my Maven project from SVN(outside of Eclipse), Eclipse will give me a lot of errors and warnings unless I import the project again. That is really annoying. I have to import the project every time that I update it from SVN.
Is there a solution?
Thanks a lot. :)
Install Subclipse see here: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
Then install, m2eclipse and m2eclipse extras as mentioned here: http://m2eclipse.sonatype.org/installing-m2eclipse.html
After, these are done.
Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring
Add URL to SVN repository/code base.
Select a project. Right Click and select Checkout as Maven Project. You're done.
Now, update, commit, delete, build all from inside Eclipse.
Install m2e and subclipse from the Eclipse Marketplace depending on what version of Eclipse you have. Then:
Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring.
Add your svn url to SVN repository/code base.
Select a project. Right Click and select Checkout.
Assuming your project has a pom.xml, switch back to your Java perspective, select the project that was just imported, right click and select Configure > Convert to Maven Project.
try the other plugin of maven may be more stable.
http://www.eclipse.org/iam/
Svn have a very stable plugin
But frankly it's not working good think about switching to intellij if you work with maven the integration between the IDE and maven is really working period
may be the free version of intellij is enough for your needs