I'm trying to build a restful api using a Maven project and tomcat in eclipse.
in the maven project wizard i am using 'org.glassfish.jersey.webapp.archetypes' 'jersey-quickstart-webapp' version 2.26:
the problem is - after the project is build, tomcat dosn't recognize the
maven project as a resource:
I'v tried to add the target runtime in the project properties but it won't
show up:
How can i correct this? (preferably using a maven)
Found the solution: I was missing m2e-wtp - JAX-RX configurator for WTP plugin in my eclipse:
To fix this issue:
1) Go to help->install new software
2) Select eclipse repository (I'm using Oxygen this will be different for another eclipse version)
3) Under: Web, XML, Java EE and OSGi Enterprise Development
select: m2e-wtp - JAX-RX configurator for WTP
4) Proceed Installation and restart eclipse
Note that an existing maven project will not automatically be fixed but a new project will be set correctly
Related
I am using Kepler 4.3.2 and Maven compiler plugin 3.1, GWT 2.6.1 plugin and Java 1.7 , Tomcat 7.0 using the following steps.
Create GWT project
Configure it into maven prject.
Add dependency in pom.xml.
Add module name in *.gwt.xml file.
Select project->properties->project facets-> dynamic web 3.0 and java 1.7.
Update maven project.
Fixing all the warnings and errors.
Still I am having a problem to run the project that invalid thread excess Java NullPointerException.
I want to run this project on Jetty.
Where am I going wrong?
I'm using Spring Tool Suite (STS) [Version: 3.1.0.RELEASE] to make Spring project using Spring 3 + Hibernate. I want to use eclipse for that.
What to do? What eclipse plugin should be installed in eclipse for making Spring project?
By Eclipse Marketplace:
Open eclipse --> Help --> Eclipse Marketplace
Search by keyword "STS"
Click Install button on "Spring Tool Suite (STS) for Eclipse Indigo (3.7)" section
Follow the eclipse instruction
The following is the Classic way:
In Eclipse IDE: Click “Help” -> “Install New Software…”. Type “http://springide.org/updatesite” to access the Spring IDE update site.
Select all the Spring IDE features you want to install. And wait as it needs - that's it
If you already using STS you can easily create Spring projects - no additional plugins needed.
STS is Eclipse with Spring plugins added - don't waste your time doing it manually.
In the main menu select File > New > Other...
Type "Spring" in the search bar.
Select "Spring Template Project", click "Next"
Open "Persistence" node and select "Simple Spring Hibernate Utility Project" and follow the wizard.
After wizard is done you are going to have simple Spring/Hibernate project in your workspace.
UPDATE:
Spring projects are simple java projects and be created easily using just Maven. Add m2e plugin if you don't have it yet and add required spring jars as dependencies in your pom.xml file.
M2E comes preinstalled with STS, but can be installed into any Eclipse installation.
More information about using m2e can be found at http://www.sonatype.org/m2eclipse
I'm new to Grails development and would like to set up a new project, so I can use Eclipse as IDE and build it on my CI (Jenkins) with Maven. This is my environment:
Java 1.6.0
Grails 2.1.0
Maven 2.2.1
Eclipse Juno with the m2e and egit plugins
I used the following commands from
http://grails.org/doc/latest/guide/commandLine.html#antAndMaven:
mvn archetype:generate -DarchetypeGroupId=org.grails \
-DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=2.1.0 \
-DgroupId=com.company.dep -DartifactId=project
mvn initialize
But after importing it as a maven project in Eclipse, there were erros about slf4j and com.sun.tools not found and lifecycle phases not mapped.
What steps are necessary to get this running in Eclipse?
Plugins, Plugins, Plugins... you can add the maven plugin / Grails plugin for eclipse and just build a new project.
Select the option to create a maven project (it will auto generate the pom files for you) then you can add Grails to it...
Similarly you can start a new grails project and then add maven to it. It will download all the dependencies automatically.
Most plugins are free to download from : http://marketplace.eclipse.org
com.sun.tools error is commonly caused when Eclipse uses a JRE and not JDK.
Grails has its own mechanism for creating projects, use it. Since Grails 2.1 you can generate the maven stuff afterwards.
You can follow this proces:
Get STS - Springsrouce Tool Suite (actual 3.0), based on Eclipse
Install the Grails plugin into STS.
Get the Grails FW, unpack it and configure the path to it in STS.
Create new project via Grails command: grails create-app
Import it into Git.
About maven integration, there is a good article:
http://www.znetdevelopment.com/blogs/2012/07/11/grails-2-1-and-maven-integration-simple-project/
I am in Eclipse Indigo and trying to install Maven Support for eclipse. I search Eclipse Marketplace with "maven" and found there are two entries:
Maven Integration for Eclipse WTP.
Maven Integration for Eclipse.
Now I am confused to choose them.
I am developing web application. So what is the entry I should go for?
Install them both. The first is specifically designed to integrate with WTP, the second one is general Maven integration in Eclipse.
Have you tried to just use Maven? With Indigo, m2e is already integrated. If you look at eclipse.org, you will find there the following features integrated:
If you open the preferences in Eclipse (Windows > Preferences), you will find there the Maven configuration for Eclipse:
You have to configure there, where your Maven installation lives, and can start to use Maven inside Eclipse.
I have an existing Dynamic Web Project in Eclipse Indigo and the m2e plugin installed. In another version of my eclipse setup that I dont quite remember (my hdd crashed) I could just right click on the project -> Maven -> Enable Dependency Management.
This menu is gone for my Dynamic Web Project in my current eclipse version. Whats the way to go now? I tried right click on the project folder -> configure -> convert to maven project but that fails with errors.
M2Eclipse has migrated to an Eclipse project from Sonatype called m2e. Therefore in you Eclipse Indigo you have installed m2e whereas your old Maven projects in the older Eclipse version were created with M2Eclipse according to your right-click description. Now under normal circomstances everything should be working flawlessly and we wouldn't have this discussion. Unfortunately with the move of the project the namespace has changed from org.maven.ide.eclipse to org.eclipse.m2e.core and old Maven projects created with M2Eclipse are not immediately recognised as Maven projects in m2e. Here's a description of how to migrate your projects accordingly.
Erik, importing an existing maven project would let m2e discover and propose you to install m2e-wtp, the Maven Integration for Eclipse WTP plugin. Since you're starting from scratch, you should install m2e-wtp yourself (see https://github.com/sonatype/m2eclipse-wtp/wiki).
Now in order to quickstart a new mavenized web project, you should go to the "New Project" menu and choose new Maven project.
At this point, either you choose to create a "simple" project, in which case you need to select the "war" packaging on the following screen, or use a maven archetype, which will quickstart a new preconfigured web project, with the flavor you want (jsf, spring ...). The m2e-wtp wiki has links to help you get started.
Note : at this point Eclipse to Maven conversion is pretty much inexistant (only creates a bare pom.xml), that's why I recommend to create a maven project first. Hopefully, this should get better in the next m2e 1.1 (June 2012)