maven 新建站点

  1. 站点建立步骤
    启动eclipse_sts--->新建项目--->搜索maven -->选择maven-archetype-webapp

  2. 红色错误配置
    新建项目完成后--->index.jsp 出现红色错误--->原因在于没有为index.jsp指定运行环境如tomcat
    操作:选择站点——>右键-->build path--> limbraris-->add limbraris->选择server run 服务器运行环境
    本选择是tomcat8.5 具体你的根据你自己情况
    1. pom.xml 架包jar
      <properties>
              <spring.version>4.0.9.RELEASE</spring.version>
          </properties>
        <dependencies>
          <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>  
                   
          </dependency>
      <!-- spring包 -->
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-aop</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-beans</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-context</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-context-support</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-core</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-expression</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-jdbc</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-orm</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-test</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-tx</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-jdbc</artifactId>
                  <version>5.1.9.RELEASE</version>
              </dependency>
        <!-- 添加mybatis  jar -->
              <dependency>
                  <groupId>org.mybatis</groupId>
                  <artifactId>mybatis</artifactId>
                  <version>3.5.2</version>
              </dependency>
              <dependency>
              
              <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-log4j12</artifactId>
                  <version>1.7.5</version>
              </dependency>
              
               <dependency>
                  <groupId>mysql</groupId>
                  <artifactId>mysql-connector-java</artifactId>
                  <version>5.1.25</version>
              </dependency>

       

      如上代码中:
      <!-- 添加mybatis  jar -->
    2.         <dependency>
                  <groupId>org.mybatis</groupId>
                  <artifactId>mybatis</artifactId>
                  <version>3.5.2</version>
              </dependency>
              <dependency>
    3.  特别强调:查看 mybatis架包是不成功
      到java build config-->libraries->maven dependeces -->查看mybatis3.5.2.jar
posted @ 2019-09-29 17:20  码哥之旅  阅读(291)  评论(0编辑  收藏  举报