Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add my application to Tomcat in Eclipse?

I have a web app built with Maven. Most of the time, I built the application using Intellij IDEA, but now I want to import the application in Eclipse to see something in this IDE.

After mvn eclipse:eclipse, I add in Eclipse the app, but when I try to add the app to the server (tomcat), I receive:

There are no resources that can be added or removed from the server 

Solutions?

like image 684
Aaron Avatar asked May 09 '10 09:05

Aaron


People also ask

How can I add Tomcat server to Eclipse?

For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.

Where is Tomcat preference in Eclipse?

In Eclipse, go to Window > Preferences > Tomcat. If you don't see Tomcat in the high-level preferences tree, you might have the wrong Tomcat plugin, it might not be installed properly, or you might need a clean Eclipse start. Select the appropriate Tomcat version, such as version 7. x.

Can we use Tomcat as application server?

Apache Tomcat (Link resides outside IBM) is an open source application server that executes Java Servlets, renders and delivers web pages that include JavaServer Page code, and serves Java Enterprise Edition (Java EE) applications. Released in 1998, Tomcat is the most widely used open source Java application server.


2 Answers

This step worked for me:

Right-Click on the Project Name, then Maven-->Update Project.. Click OK

After doing this I was able to see my project in Add/Remove Programs.

As mentioned somewhere else adding Eclipse WTP didn't do any good, however I performed the above step after I had already added Eclipse WTP, so I am guessing that may not be needed. This was done for Eclipse Juno.

Hope this helps someone.

Edited: You can follow this link as above mentioned I think might have needed WTP and that add a lot of other things into the workspace.

http://blog.teamextension.com/maven-as-eclipse-dynamic-web-module-556

like image 22
MAB Avatar answered Nov 16 '22 01:11

MAB


You need the project to have a Eclipse Dynamic Web Module facet. You can try doing this via the project properties dialog and looking at project facets, then clicking the appropriate check box. This may not be available however, so you may need to do the next thing.

Create a backup of your project and follow the directions at dzone.com. This'll allow you to modify the project facets via your eclipse .project file.

Keep in mind, once you add those facets, you cannot change them back via Eclipse. Definitely make sure you have a backup before starting.

like image 101
ClutchDude Avatar answered Nov 16 '22 01:11

ClutchDude