Eclipse中Project的Deployment Assembly(部署程序集)消失了

时间:2022-04-22
本文章向大家介绍Eclipse中Project的Deployment Assembly(部署程序集)消失了,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

可能的原因主要有2个:

1. 该项目不是web项目,所以不存在Deployment Assembly 属性。在Eclipse中,怎样将一个非web project变成一个web project?

1)右键项目,选择Project Facets,点击Convert to faceted from

2) 配置Project Facets 更改Dynamic Web Module的Version为2.5。(3.0为Java7的)。 如果提示错误,可能需要在Java Compiler设置Compiler compliance level 为1.6。或者需要在此窗口的Java的Version改成1.6。 3) 配置 Modify Faceted Project 点击Further configuration available…,弹出Modify Faceted Project窗口 此处是设置web.xml文件的路径,我们输入src/main/webapp。 Generate web.xml deployment descriptor自动生成web.xml文件,可选可不选。 2. 经过1的project转换后,应该能够看到Deployment Assembly出现了,但如果还么出现,很有可能在Eclipse中Deployment Assembly被disable了,那么我们需要做的就是将Deployment Assembly选项enable。 在项目所在的工作区间有一个.project文件,打开该文件增加如下这一行用于enable Deployment Assembly属性。 <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> 如下面的.project file.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>test</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.common.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.m2e.core.maven2Nature</nature>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        <nature>com.google.gwt.eclipse.core.gwtNature</nature>
      <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    </natures>
</projectDescription>

 然后刷新或重启, 就可在Project的properties中看到Deployment Assembly选项了。