myeclipse 2014新建maven web 项目步骤

时间:2023-03-09 19:09:14
myeclipse 2014新建maven web 项目步骤

首先在myeclipse中配置maven的安装路径:

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

在pom.xml中加上:

1
2
3
4
5
6
7
8
9
10
 <plugins>     
     <plugin> 
        <groupid>org.apache.maven.plugins</groupid> 
        maven-resources-plugin</artifactid> 
        <version>2.6</version> 
         <configuration> 
           <encoding>utf-8</encoding> 
         </configuration> 
      </plugin>
  </plugins>

如果项目结构没有Maven Dependencies

myeclipse 2014新建maven web 项目步骤

需要在项目根路径下的.classpath文件里加上

1
2
3
4
5
6
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
     
     
     
    </attribute></attribute></attributes>
</classpathentry>

如果项目启动时报maven与jdk版本不对应,需要添加一行代码:

MAVEN_HOME是你在环境变量里配置的maven安装路径

1
1
-Dmaven.multiModuleProjectDirectory=$MAVEN_HOME

myeclipse 2014新建maven web 项目步骤

myeclipse 2014新建maven web 项目步骤

本人搭建的maven web项目,框架用spring springMVC mybatis,架包都是最新的,已经上传,需要的可以下载