简体   繁体   中英

Eclipse Spring Maven project

I'm kind of new to Eclipse.

So I installed the latest Eclipse Juno, m2e and SpringIDE.

I failed ho understand how to create a Maven Spring project with the above combination of software.

The only options that Eclipse UI gives me is either a Maven project, or a Spring project: 在此处输入图片说明

I know that it IS possible to have a Maven/Spring project in Eclipse, and I actually have one:

在此处输入图片说明

But to make it possible I had to create a Spring project and to manually edit its .project file to include Maven nature and build command:

<buildSpec>
    <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.springframework.ide.eclipse.core.springbuilder</name>
        <arguments>
        </arguments>
    </buildCommand>
    <buildCommand>
        <name>org.eclipse.m2e.core.maven2Builder</name>
        <arguments>
        </arguments>
    </buildCommand>
</buildSpec>
<natures>
    <nature>org.springframework.ide.eclipse.core.springnature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>

and .project file to include build path:

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    <attributes>
        <attribute name="maven.pomderived" value="true"/>
    </attributes>
</classpathentry>

Question:

How do I do that from Eclipse UI without .project file modification?

It there any way I can add natures to Eclipse projects from UI?

Thanks

尝试在项目资源管理器中右键单击项目->配置->转换为Maven项目

添加Spring Project Nature

This option is available eg when using SpringSource Toolsuite

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM