Eclipse 创建 maven 项目动态 web 工程

Eclipse 创建 maven 项目动态 web 工程

一、操作环境

  1. Eclipse Oxygen 4.7.0
    eclipse版本.png
  1. maven 3.5.0
    maven版本
  1. JDK 1.8.0_20
    jdk1.8
  1. Apache Tomcat 7.0
    Tomcat7

二、创建 maven 的 web 项目

  1. 新建项目 File(或者选择 Eclipse 左侧的 “Package Explorer” 中的某个工作集,右键 ) -> New -> Other,在弹出的对话框中找到 “Maven” -> 选择”Maven Project” -> “Next”
    新建项目
选中Maven Project
  1. Next


    New Maven Project

注:

此处我是在我的工作集(working set) testWorkSet 上点击右键来创建的项目。因此,会自动将创建项目添加到 Test 工作集。此处不用任何设置,直接 Next 即可。

  1. 选择 maven 项目模板 在弹出的对话框中找到 Artifact Id 为 “maven-archetype-webapp” 的条目,点击 “Next”
    选中webapp

注:

此处可在 Filter 后的文本框中输入 “webapp” 来进行快速过滤与定位

如果同一个 Artifact 有多个版本,请选择最新版本(”Show the last version of Archetype only” 勾选了则不会出现多个版本)

  1. 设置 maven 项目信息

在 “Group Id”,”Artifact Id”,”Package” 后的文本框中设置该项目的信息,然后点击 “Finish”

设置Maven 项目信息

注:

  • Group Id 的设置一般使用公司或者组织的倒置域名。例如:spring-mvc 项目的 groupId 为 org.springframework,artifactId 为 spring-webmvc
  • Artifact Id 设置为该项目的名称。例如:apache 组织的 tomcat 项目,groupId 为 org.apache,artifactId 为 tomcat
  • Package 是为 maven 项目设置一个包路径。如此处:groupId 为 com.jzl,artifactId 为 mvnweb,则 Package 自动生成为 com.jzl.mvnweb。Package 路径设置也可以不使用默认的规则,完全可以自由设定,甚至为空,不过约定俗成的方式一般是使用公司或者组织的倒置域名加上项目名组成。
  • version 在首次创建的时候保持默认即可,它用来标识项目的版本
  • 此处设置的 groupId、artifactId、version 等信息会在项目创建完成后生成到 pom.xml 配置文件中,并且如果你的项目是需要作为第三方依赖提供给其他人使用,此处设置的信息也对应到对方配置的 pom.xml 中的 标签中的配置。当然,这些信息也可以在项目创建完成以后在 pom.xml 中来更改。
  1. 完成项目创建

在上一步中点击 “Finish” 后,等待一段时间,项目创建完成,会生成一个如下图所示的项目结构。至此,项目创建完成


目录结构

注:

如果是第一次使用 eclipse 的 maven 创建项目,会从 maven 仓库下载一些依赖包,所以可能需要一点时间(取决于网速与电脑配置),请耐心等待(右下角状态栏会有下载的进度条信息)

结构。至此,项目创建完成

在这里插入图片描述

注:

如果是第一次使用 eclipse 的 maven 创建项目,会从 maven 仓库下载一些依赖包,所以可能需要一点时间(取决于网速与电脑配置),请耐心等待(右下角状态栏会有下载的进度条信息)

三、项目配置

配置项目 JRE

在项目创建完成后,在 workspace 中的项目根目录下生成了 .classpath 文件:mvnweb/.classpath,此文件内容如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" output="target/classes" path="src/main/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    
    <classpathentry kind="src" output="target/test-classes" path="src/test/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    
    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
            <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
        </attributes>
    </classpathentry>
    
    <classpathentry kind="output" path="target/classes"/>
</classpath>

上面的的文件内容即对应了 mvnweb -> Properties -> Java Build Path -> Source 中的 Source folders,如下所示:

Source

我们发现 Source 下的 mvnweb/src/main/java 以及 mvnweb/src/test/java 两个 Source 目录前面有红叉,后面有括号显示为 missing,并且 Package Explorer 中也没有显示 src/main/java 以及 src/test/java 这两个 source folder。但当我们右键 mvnweb -> New -> Source Folder -> 填写 src/main/java 时显示为已经存在此 Source Folder。

原因是 maven 项目生成的 .classpath 中使用的 JRE_CONTAINER 是 J2SE-1.5,而在 Eclipse 中配置的 Installed JREs 中,设置的 JRE 版本与 1.5 不匹配。

解决方法就是配置正确的 JRE 环境:
右键 mvnweb -> Build Path -> Configure Build Path -> Libraries -> “JRE System Library [J2SE-1.5]” -> Edit

Libraries

在弹出的对话框中,选择 “Workspace default JRE(jdk-1.8.0_20)” -> Finish

选中JER版本

注:

  • 也可以使用 Execution environment -> 选择 J2SE-1.8 (jdk-1.8.0_20) 或者 Alternate JRE -> 选择 jdk-1.8.0_20
  • 此处的 “jdk-1.8.0_20” 与你系统中安装的 JDK 以及在 Eclipse 中配置的 JDK 有关,如果使用的其他版本的 JDK,则以安装的 JDK 版本为准

如下: Window -> Preferences -> Java -> Installed JREs

安装JRE

在设置了正确的 JRE 后,可以看到 Source folders 下面的显示已经正常,而且 Package Explorer 中这两个资源目录也显示出来了

Source
目录结构

可以双击 Source 下的各项属性来配置 Source 属性(当然,你也可以在 mvnweb/.classpath 文件中修改),如 output folder,不过此处保持默认即可:

配置Source属性
目录结构

配置 Java 编译器版本 (Java compiler level)

当把 JRE 配置到当前 Eclipse 使用的 JDK 之后,解决了资源目录不显示的问题,但又出现了新问题,可能看到 mvnweb 项目名称前面出现了红叉,而 Problems 视图中则显示了问题的原因(Java 编译器版本不匹配)如下:

Java 编译器版本不匹配

解决方法如下:

(1) 确保 Java Compiler 的版本与 Java Build Path 中的 JRE 版本一致:

mvnweb -> 右键 -> Properties -> Java Compiler -> JDK Compliance -> 确保 Use compliance from execution evironment 已经勾选,并且版本一致。

Java Compiler 编译器版本

此处配置对应 mvnweb/.settings/org.eclipse.jdt.core.prefs 文件,内容如下:

eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

如果不勾选 “Use compliance from execution evironment”,也可以自行在下方设置 “Java Compiler level”

选中JDK版本

(2) 配置 Project Factets 中的 Java Version

mvnweb -> 右键 -> Properties -> Project Facets -> Java -> Version -> 1.8 -> “Apply and close”

Project Factets 中的 Java Version

可以看到,mvnweb 项目的错误已经没有了。

(3) 配置 maven compiler 版本(重要)

当你以为配置了上面两部分配置,似乎已经完美解决了问题时,其实这一步才是非常重要,也是最大的一个坑。
双击 mvnweb/pom.xml -> 左下角标签栏 pom.xml,可以看到新创建的 maven 项目除了项目基本信息和一个 junit 的依赖包,并没有其他的设置。那么问题来了,maven 如何实现对项目的打包,更新,编译等等一系列操作的呢?

pox.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jzl</groupId>
  <artifactId>mvnweb</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>mvnweb Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>mvnweb</finalName>
  </build>
</project>

答案就在 Effective POM 标签页中,点击 pom.xml 左侧的 Effective POM 标签页,可以看到这个标签页中有很多的 maven 插件。因为 Effective POM 是包含了从 maven 的超级 POM 中继承的元素以及项目配置的 pom 属性。

Effective POM :

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jzl</groupId>
  <artifactId>mvnweb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>mvnweb Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <sourceDirectory>D:\eclipseWorkspace\mvnweb\src\main\java</sourceDirectory>
    <scriptSourceDirectory>D:\eclipseWorkspace\mvnweb\src\main\scripts</scriptSourceDirectory>
    <testSourceDirectory>D:\eclipseWorkspace\mvnweb\src\test\java</testSourceDirectory>
    <outputDirectory>D:\eclipseWorkspace\mvnweb\target\classes</outputDirectory>
    <testOutputDirectory>D:\eclipseWorkspace\mvnweb\target\test-classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>D:\eclipseWorkspace\mvnweb\src\main\resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>D:\eclipseWorkspace\mvnweb\src\test\resources</directory>
      </testResource>
    </testResources>
    <directory>D:\eclipseWorkspace\mvnweb\target</directory>
    <finalName>mvnweb</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2-beta-5</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.3.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>default-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>default-testResources</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>testResources</goal>
            </goals>
          </execution>
          <execution>
            <id>default-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>default-war</id>
            <phase>package</phase>
            <goals>
              <goal>war</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>default-install</id>
            <phase>install</phase>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
        <executions>
          <execution>
            <id>default-site</id>
            <phase>site</phase>
            <goals>
              <goal>site</goal>
            </goals>
            <configuration>
              <outputDirectory>D:\eclipseWorkspace\mvnweb\target\site</outputDirectory>
              <reportPlugins>
                <reportPlugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                </reportPlugin>
              </reportPlugins>
            </configuration>
          </execution>
          <execution>
            <id>default-deploy</id>
            <phase>site-deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
            <configuration>
              <outputDirectory>D:\eclipseWorkspace\mvnweb\target\site</outputDirectory>
              <reportPlugins>
                <reportPlugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                </reportPlugin>
              </reportPlugins>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <outputDirectory>D:\eclipseWorkspace\mvnweb\target\site</outputDirectory>
          <reportPlugins>
            <reportPlugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
            </reportPlugin>
          </reportPlugins>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <outputDirectory>D:\eclipseWorkspace\mvnweb\target\site</outputDirectory>
  </reporting>
</project>

注:

  • 所有的 POM 都继承自一个 maven 的基类,这个基础的 POM 被称为超级 POM,并包含默认值。
  • Maven 使用 Effective POM (超级 POM 加项目配置的属性) 执行操作。它可以帮助开发人员指定最低配置的详细信息写在 pom.xml 中。
  • 如果在项目的 pom.xml 中没有配置某一属性,那么 maven 在执行操作时就会使用 Effective POM 中从超级 POM 继承的默认配置。而如果项目中配置了某属性,则会直接覆盖超级 POM 中的配置。

说了这么多,问题的关键就在于如果没有在项目的 pom.xml 中配置 maven-compiler-plugin,而 maven 又需要使用此插件,那么 maven 在进行编译时就会使用 Effective POM 中默认的 maven-compiler-plugin 配置,而从上面的截图也可以看到,默认的 compiler-plugin 没有配置编译版本(默认使用的是 JDK 1.5)。因此,当我们进行任何的 maven 操作时,就会将项目的 JDK 版本又设置到 JDK-1.5 的版本,导致我们前面所配置的 JRE,Java Compiler 都失效。

说明:

Maven官方文档有如下描述:

编译器插件用来编译项目的源文件.从3.0版本开始,

用来编译Java源文件的默认编译器是javax.tools.JavaCompiler (如果你是用的是java 1.6) 。

如果你想强制性的让插件使用javac,你必须配置插件选项 forceJavacCompilerUse。
同时需要注意的是目前source选项和target 选项的默认设置都是1.5, 与运行Maven时的JDK版本无> > 关。

如果你想要改变这些默认设置, 可以参考 Setting the -source and -target of the Java Compiler中的描述来设置 source 和target 选项。

这是Maven已知的一个特性。除非在你的POM文件中显示的指定一个版本,否则会使用编译器默认的source/target版本1.5。主要还是在于Eclipse中Maven的集成方式起到了关键作用, 它会从POM文件中生成项目的.project,.classpath以及.settings, 因此除非POM文件指定了正确的JDK版本, 否则你每次更新项目配置的时候它都会重置到1.5版本。

解决方法是

方法一: 在 pom.xml -> project -> build 节点下,添加如下内容:

<plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <compilerVersion>1.8</compilerVersion>
            <fork>true</fork>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
    </plugin>
</plugins>

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jzl</groupId>
  <artifactId>mvnweb</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>mvnweb Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>mvnweb</finalName>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <compilerVersion>1.8</compilerVersion>
                <fork>true</fork>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
  </build>
</project>

注:

  • 如果你的 build 下已经配置过 节点了,那么就在 节点下面添加 部分的内容即可
  • 与 节点配置的版本与上面配置的 JRE 与 Java Compiler 版本一致 (即当前使用的 JDK 版本)

方法二: 修改maven的配置文件 setting.xml

<profile>    
    <id>jdk-1.8</id>    
    <activation>    
        <activeByDefault>true</activeByDefault>    
        <jdk>1.8</jdk>    
    </activation>    
    <properties>    
        <maven.compiler.source>1.8</maven.compiler.source>    
        <maven.compiler.target>1.8</maven.compiler.target>    
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
    </properties>    
</profile> 

最后, 右键 mvnweb -> Maven -> Update Proejct,编译版本问题解决

配置 web app version

由于 maven 使用 maven-artchetype-webapp-1.0 创建的 web-app 模板默认的 Dynamic Web Module 版本是 2.3,对应的 servlet 版本比较低,,如下所示:

mvnweb/src/main/webapp/WEB-INFO/web.xml

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"; >
<web-app>
    <display-name>Archetype Created Web Application</display-name>
</web-app>

改为:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>Archetype Created Web Application</display-name>
</web-app>

Proejct Facets

Dynamic Web Module版本

注:
此处对应的配置文件是 mvnweb/.settings/org.eclipse.wst.common.project.facet.core.xml

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
    <fixed facet="wst.jsdt.web"/>
    <installed facet="jst.web" version="2.3"/>
    <installed facet="wst.jsdt.web" version="1.0"/>
    <installed facet="java" version="1.8"/>
</faceted-project>

由于在操作时发现在 Dynamic Web Module 后面的 Version 处选择 版本 3.0 显示不能从 2.3 转换到 3.0 (此处原因不详,但我把 Dynamic Web Module 前的勾去掉再重新勾选可以转换)。采取直接修改配置文件的方式,将上方的 org.eclipse.wst.common.project.facet.core.xml 改为:

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
    <fixed facet="wst.jsdt.web"/>
    <installed facet="jst.web" version="3.0"/>
    <installed facet="wst.jsdt.web" version="1.0"/>
    <installed facet="java" version="1.8"/>
</faceted-project>

然后 右键 mvnweb -> Refresh,可以看到 Project Facets 中的 Dynamic Web Module 已经变成了 3.0 版本

四、eclipse 中运行 maven web 项目

右键 mvnweb -> Run As -> Run on Server -> 选择一个本地配置好的运行时 Server (配置方法见附录二) -> Finish

选择Tomcat
浏览器界面

至此,一个完整的,规范的 maven web 项目搭建完成。

附录一:配置 Project Facets Runtimes

在 Project Facets -> Runtimes 中可以配置一个运行时环境,但前提是你必须已经安装有 java web 的运行时环境,比如 tomcat 7,在勾选了运行时环境后,会将运行时环境中的 jar 包加载到项目中。此步骤一般不用设置。

配置 Project Facets Runtimes

附录二:配置 Runtimes 环境

运行时环境配置: Window -> Preferences -> Server -> Runtime Environments -> add -> 选择运行时环境及版本(如 apache tomcat v7.0)

配置 Runtimes 环境

填写一个运行时环境的名字(任意取,只用来做标识用) -> 选择运行时安装的路径 -> 选择 JRE -> Finish

Tomcat Server

附录三:修改项目部署组件

右键 mvnweb -> Properties -> Deployment Assembly

Deployment Assembly

附录四:项目 Eclipse 配置文件

  1. 可以在 eclipse 的 workspace 中的项目目录下找到
配置文件路径

在 eclipse 中的 navigator 中查看
Window -> Show View -> Other -> General -> Navigator -> Open

Navigator
项目配置文件

转自 : Eclipse 创建 maven 项目动态 web 工程
对原文进行了排版和少量的修改

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 160,277评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,777评论 1 298
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,946评论 0 245
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,271评论 0 213
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,636评论 3 288
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,767评论 1 221
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,989评论 2 315
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,733评论 0 204
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,457评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,674评论 2 249
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,155评论 1 261
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,518评论 3 258
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,160评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,114评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,898评论 0 198
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,822评论 2 280
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,705评论 2 273