In Eclipse, "Update Maven Dependencies" is disabled and greyed-out, why? - eclipse

I'm using Eclipse STS 2.7.1 and created a new Spring Template/MVC project. I deleted the pom file and replaced it with one from another project that has all the dependencies I need. But when I attempt to update the dependencies, the menu option is disabled...why?

Instead of using the Spring Tools maven option, select Maven->Update Dependencies. That should do the trick!

Related

Missing Maven Dependencies Folder in Spring Tool Suite

I'm currently attempting to configure a Maven project in Spring Tool Suite for use with Tatool. I was watching this tutorial video and my project is identical to his after it is created except for the fact that it is missing a Maven Dependencies folder and I am also unable to "create" new dependencies (although I can add them). What gives?
Apologies in advance for the elementary nature of this question, but I'm new at this.
I am guessing that either:
Your project is not a maven project. Right click on project -> Configure -> Convert to maven project
You do not have m2e installed. Open STS dashboard, click extensions at bottom and install m2e
Nevermind, resolved it. The tutorial was using an old version of STS which had a "create" button in addition to the "add" button under the dependencies tab of the POM. All I had to do was add a dependency and the folder showed up.

Eclipse Indigo with m2e can't find maven dependencies in a multi-module project

I've created a multi-module project using Indigo with m2e 1.0. One of the child modules has a dependency on the other. It all builds correctly under maven.
Eclipse, however, can't find any of the classes that this module uses from the dependency .jar. The project properties shows the artifact under Maven Dependencies, but it does not show the actual .jar file itself.
I added the dependency with the Maven menu for this project.
The .project and .classpath got generated automagically at some point. I did not have to run mvn eclipse:eclipse or mvn eclipse:m2e (or whatever the goal is for m2e). The .classpath doesn't have the dependent .jar in it, but it does have org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER.
I've tried all the options under the Maven menu (update dependencies, update configuration) and refreshing the project. I've closed and re-opened Eclipse. It still shows errors.
This makes Eclipse worthless as a Java editor in multi-module projects. I could manually add the dependency .jar in the .classpath, but this defeats the purpose of integration Eclipse and Maven with m2e.
Is there any solution for this in Eclipse?
Thanks.
The answer turned out to be the last answer to this question given by Jody Box. It's pretty bizzare that in order for Eclipse to resolve dependencies from another project in the Workspace that you have to uncheck the "Resolve dependencies from Workspace projects" checkbox.
I know mvn can be convoluted but this checkbox is doing the opposite of what it says.

Eclipse:Run on server option not visible for maven project

I'm running through the jboss as7 getting started guide here http://hudson.jboss.org/jenkins/job/JBoss-AS7-Docs/lastSuccessfulBuild/artifact/guides/developer-getting-started-guide/target/docbook/publish/en-US/html/helloworld.html . The tutorial has us setting up an example helloworld quickstart maven project.
I'm able to deploy this project from the command line successfully
mvn package jboss-as:deploy
but when I attempt to deploy the helloworld example from Eclipse - the 'run on server' option is missing from the run menu. I have Eclipse 3.7 and maven wtp installed.
Not sure how to fix, any advice appreciated.
The run on server related options only appears if your project has the Dynamic Web Moudle project facets.
You can try to configure it using the Project Facets options in your project properties
To help any other developer with this problem.
I was dealing with this issue recently. Maven projects are structured differently than Dynamic Web Projects. So when you manually add the Dynamic Web Module using Project Facets, eclipse may not register it properly as a Maven project.
To solve this, you have to install the m2e plugin and M2E Eclipse WTP plugin (this tells Eclipse how to run your maven projects).
Go to Help -> Eclipse Marketplace to search for the plugins.
After installing, you will need to restart Eclipse then you will be able to use "run on server" for your Maven projects.
Note: You may need to remove/delete the previous project then import/create it again after the restart.
You have to add maven eclipse pluginin your pom.xml file..
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
</plugin>
According to Red Hat's site, The M2E Eclipse WTP plugin (m2eclipse-wtp) has been deprecated in favor of the newer m2e-wtp plugin. If you don't want to go through the marketplace, the URL for the new plugin is http://download.eclipse.org/technology/m2e/releases.
After copying the project and refreshing it, closing and reopening it, removing and re-adding it (right-click on server) and updating Maven... the option reappeared.
I think it occurs when you up the version of the Java compiler in your .pom file, when you up the compiler in project properties or it has to do with using the newer Jersey (2) version or when you both include local libraries and maven dependencies, it may also be a consequence of a combination of these. It's pretty unclear.
Note though, that you can still add/remove projects by right-clicking on the server in the servers tab.

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...

Grails regenerate Eclipse project

I just upgrade Grails to 1.2.0. How can get Grails to regenerate the Eclipse .classpath file? It's currently pointing to the old Grails' JARs.
Right-click on the project node and select Configure|Convert to Grails Project. It'll setup a "Grails Dependencies" library pointing to the Grails jars, and it'll setup links to your plugin libs and folders. You will lose the entries for jars in the lib dir - my guess is that there's an assumption that you'll use Ivy for dependency management.
there is an option to upgrade grails using command line. "grails upgrade"
That should upgrade your app..
before that you need to change your grails_home variable to point to your latest version.
Hope it helps.
Right click on the project name in the "Project Explorer" -> choose "Properties"
In the "Properties for window, look for the grails option on the left side.
Once in there, there should be a drop down for the grails version that the project was initially confugured/imported with. This should be changed to your new version.