Idea's Gradle project is imported into eclipse

Source: Internet
Author: User
Tags apache tomcat


Background: In eclipse, SVN checks out the project, discovers that the item does not have a grable icon, deletes the item (does not delete the actual folder), then Import-gradle project, and the item displays the Gradle icon after the import.

Then build path, add JRE and Tomcat, and after this is done, there are many other issues:

1, right-gradle-Reflesh Gradle project, error

Java cannot nest inside library ....


To change the Build.gradle file, delete the following sentence:

Apply plugin: ' idea ' Apply plugin: ' War ' webappdirname = ' webcontent '

2, you can now successfully Reflesh Gradle project, click on the bottom right

Can build successfully

Then you want to add the item to tomcat, and the result is that the item does not appear on the left side of the window


Right-click Project propeties---> Project facets

Go to configure, after the configuration is the following diagram:

3, can now add into Tomcat, thought I src below a few source folder, but also to configure the deployment, the map of these files as if I manually added

4, after starting Tomcat, discover


Go to WebApps below to see, found Web-inf under no Lib,

Compared to other gradle items, it was found that the following yellow sections are missing in the. classpath file:

<Classpath>    <ClasspathentryKind= "src"Path= "Src/main/java">        <attributes>            <attributename= "From_gradle_model"value= "true"/>        </attributes>    </Classpathentry>    <ClasspathentryKind= "src"Path= "Src/main/resources">        <attributes>            <attributename= "From_gradle_model"value= "true"/>        </attributes>    </Classpathentry>        <ClasspathentryKind= "Con"Path= "org.eclipse.jdt.launching.jre_container/org.eclipse.jdt.internal.debug.ui.launcher.standardvmtype/ javase-1.7/"/>    <ClasspathentryKind= "Con"Path= "Org.eclipse.buildship.core.gradleclasspathcontainer">        <attributes><attribute  name= " Org.eclipse.jst.component.dependency "  value="/web-inf/lib "/></  attributes>                         </Classpathentry>    <ClasspathentryKind= "Con"Path= "Org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimetarget/apache Tomcat v7.0"/>    <ClasspathentryKind= "Output"Path= "Bin"/></Classpath>

Then the boot is normal.

I refer to other Gradle projects also manually changed. project file: It was also less yellow, but I copied the project's. Project all over: Forget about the problem.

<?XML version= "1.0" encoding= "UTF-8"?><projectdescription>    <name>Cpfserver</name>    <Comment>Project Cpfserver created by Buildship.</Comment>    <Projects>    </Projects>    <Buildspec>        <Buildcommand>            <name>Org.eclipse.wst.jsdt.core.javascriptValidator</name>            <arguments>            </arguments>        </Buildcommand>        <Buildcommand>            <name>Org.eclipse.wst.common.project.facet.core.builder</name>            <arguments>            </arguments>        </Buildcommand>        <Buildcommand>            <name>Org.eclipse.jdt.core.javabuilder</name>            <arguments>            </arguments>        </Buildcommand>         <Buildcommand><name> Org.eclipse.buildship.core.gradleprojectbuilder</name><  Arguments></arguments></  Buildcommand>                                                     <Buildcommand>            <name>Org.eclipse.wst.validation.validationbuilder</name>            <arguments>            </arguments>        </Buildcommand>    </Buildspec>    <Natures>        <Nature>Org.eclipse.jem.workbench.JavaEMFNature</Nature>        <Nature>Org.eclipse.wst.common.modulecore.ModuleCoreNature</Nature>        <Nature>Org.eclipse.buildship.core.gradleprojectnature</Nature>        <Nature>Org.eclipse.jdt.core.javanature</Nature>        <Nature>Org.eclipse.wst.common.project.facet.core.nature</Nature><!--<nature>org.eclipse.wst.jsdt.core.jsNature</nature> -    </Natures></projectdescription>


Idea's Gradle project is imported into eclipse

Related Article

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