Importing external projects cannot be recognized as Web projects cannot be deployed to Tomcat

Source: Internet
Author: User

1. Go to the project directory and locate the. project file, open.

2. Find ... Code snippet, add the following label content and save:

<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature><nature> Org.eclipse.jdt.core.javanature</nature><nature>org.eclipse.wst.jsdt.core.jsnature</nature>

3. Delete the files under the. setting, and copy the following files from the other Eclipse Web project (if not the new one with Eclipse) under the. setting file

. jsdtscope

Org.eclipse.jst.common.project.facet.core.prefs

Org.eclipse.wst.common.component

Org.eclipse.wst.common.project.facet.core.xml

Org.eclipse.wst.jsdt.ui.superType.container

Org.eclipse.wst.jsdt.ui.superType.name

4. Modify the contents of the project name in the Org.eclipse.wst.common.component

<?xml version= "1.0" encoding= "UTF-8"? ><project-modules id= "Modulecoreid" project-version= "1.5.0" >     <wb-module deploy-name= "Springweb" >         <wb-resource deploy-path= "/" source-path= "/webroot" tag= "Defaultrootsource"/>         <wb-resource deploy-path= "/web-inf/classes" source-path= "/SRC"/>         <property name= "Context-root" value= "Springweb"/>         <property name= "Java-output-path" value= "/springweb1/build/classes"/>     </wb-module></project-modules>  change the above so that the  deploy-name value is the same as your project name, while the Source-path Change to/webroot (if your project directory is webcontent do not change)  <?xml version= "1.0" encoding= "UTF-8"?><classpath>     <classpathentry kind= "src" path= "WebRoot"/>    <classpathentry Kind= "CoN "path=" Org.eclipse.wst.jsdt.launching.JRE_CONTAINER "/>    <classpathentry kind=" Con " Path= "Org.eclipse.wst.jsdt.launching.WebProject" >        < Attributes>            <attribute name= "Hide" Value= "true"/>        </attributes>     </classpathentry>    <classpathentry kind= "Con" path= " Org.eclipse.wst.jsdt.launching.baseBrowserLibrary "/>    <classpathentry kind=" Output " Path= ""/></classpath> 

Change <classpathentry kind= "src" path= "WebRoot"/> in Path to/webroot (if your project directory is webcontent you don't have to change it)

5, right-click on the Eclipse Project, refresh the project, you will find that the project becomes a Web project, and then added to Tomcat will find that Tomcat can recognize our project.

Importing external projects cannot be recognized as Web projects cannot be deployed to Tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.