How can I add my application to Tomcat in Eclipse?

前端 未结 11 1446
迷失自我
迷失自我 2020-12-24 00:32

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 th

相关标签:
11条回答
  • 2020-12-24 01:15

    I was able to resolve this by removing my EAR project from my Eclipse workspace, then re-importing it.

    0 讨论(0)
  • 2020-12-24 01:22

    This issue was fixed for me my installing additional eclipse modules. in particular, the ones related to m2e-wtp. just do a search for m2e in the plugins search listing for your version of eclipse

    0 讨论(0)
  • 2020-12-24 01:24

    I used

     mvn eclipse:eclipse -Dwtpversion=2.0 
    

    in command line in the folder where I had my pom.xml. Then I refreshed the project in eclipse IDE. After that I was able to add my project.

    0 讨论(0)
  • 2020-12-24 01:30

    If you face an error like "There are no resources that can be added or removed from the server", then

    1) Go to the META_INF of your websvcsEAR and go to the application.xml.
    2) Goto modules-> clickDetails and add the module that is existing. i.e., some EAR which your project demands.
    3) Click ok
    4) Now go to your server -> right click -> add and remove -> add your EAR.

    0 讨论(0)
  • 2020-12-24 01:31

    The reason why this is happening is because eclipse by default looks for the deployment descriptor in the folder {project.home}/Webcontent/WEB-INF/web.xml where as the Maven puts them in src/main/webapp/WEB-INF/web.xml.

    So when you are trying to add your project onto the server eclipse cannot find a deployment descriptor and hence you get the annoying message.

    This can be solved by adding the following entries in .settings/org.eclipse.wst.common which can be found in

    1. Project home folder in your workspace if it is a new maven project.
    2. The folder where you already imported from if you are using Import -> Maven projects.

    Make the following changes in to the org.eclipse.wst.common

    1. wb-resource deploy-path="/" source-path="/src/main/webapp"/. Add this entry.
    2. Edit --> property name="java-output-path"

    Please check the following link from more details. http://java.dzone.com/articles/webapps-eclipse-and-maven. The comments section has an excellent example with a working project.

    0 讨论(0)
  • 2020-12-24 01:34

    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.

    0 讨论(0)
提交回复
热议问题