• maven---工程建立及目录添加--


    刚开始建立maven工程目录1:
    

      

    添加web能力:

    选中工程鼠标右击点MyEclipse添加web能力:  

    然后:

    关键点:remove掉Excluded:**

    添加javaEE5库

    确保web:

    建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.etc</groupId>  <!-- 包 -根据实际情况要改->
    	<artifactId>smm_stu</artifactId><!-- 工程   根据实际情况要改 -->
    	<packaging>war</packaging>
    	<version>0.0.1-SNAPSHOT</version>
    	<name>ymh Maven Webapp</name>
    	<url>http://maven.apache.org</url>
    	<properties>
    		<!-- spring版本号 -->
    		<spring.version>3.2.4.RELEASE</spring.version>
    		<!-- mybatis版本号 -->
    		<mybatis.version>3.2.4</mybatis.version>
    		<!-- log4j日志文件管理包版本 -->
    		<slf4j.version>1.6.6</slf4j.version>
    		<log4j.version>1.2.9</log4j.version>
    	</properties>
    	<dependencies>
    		<!-- spring核心包 -->
    		<!-- springframe start -->
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-core</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-beans</artifactId>
    			<version>3.2.0.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-web</artifactId>
    			<version>${spring.version}</version>
    		</dependency>
    
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-oxm</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>${spring.version}</version>
    		</dependency>
    
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-webmvc</artifactId>
    			<version>${spring.version}</version>
    		</dependency>
    
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-aop</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-test</artifactId>
    			<version>${spring.version}</version>
    		</dependency>
    		<!-- springframe end -->
    
    		<!-- mybatis核心包 -->
    		<dependency>
    			<groupId>org.mybatis</groupId>
    			<artifactId>mybatis</artifactId>
    			<version>${mybatis.version}</version>
    		</dependency>
    		<!-- mybatis/spring包 -->
    		<dependency>
    			<groupId>org.mybatis</groupId>
    			<artifactId>mybatis-spring</artifactId>
    			<version>1.2.2</version>
    		</dependency>
    		<!-- mysql驱动包 -->
    		<dependency>
    			<groupId>mysql</groupId>
    			<artifactId>mysql-connector-java</artifactId>
    			<version>5.1.29</version>
    		</dependency>
    		<!-- junit测试包 -->
    		<dependency>
    			<groupId>junit</groupId>
    			<artifactId>junit</artifactId>
    			<version>4.11</version>
    			<scope>test</scope>
    		</dependency>
    		<!-- 阿里巴巴数据源包 -->
    		<dependency>
    			<groupId>com.alibaba</groupId>
    			<artifactId>druid</artifactId>
    			<version>1.0.2</version>
    		</dependency>
    
    		<!-- json数据 -->
    		<dependency>
    			<groupId>org.codehaus.jackson</groupId>
    			<artifactId>jackson-mapper-asl</artifactId>
    			<version>1.9.13</version>
    		</dependency>
    
    		<!-- 日志文件管理包 -->
    		<!-- log start -->
    		<dependency>
    			<groupId>log4j</groupId>
    			<artifactId>log4j</artifactId>
    			<version>${log4j.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-api</artifactId>
    			<version>${slf4j.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-log4j12</artifactId>
    			<version>${slf4j.version}</version>
    		</dependency>
    		<!-- log end -->
    	</dependencies>
    	<build>
    		<finalName>springmvc</finalName>
    		<directory>${project.basedir}/target</directory>
    		<outputDirectory>${project.build.directory}/classes</outputDirectory>
    		<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
    		<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
    		<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
    	</build>
    </project>
    

      建包:

  • 相关阅读:
    done M&T 银行,十五分钟就结束的简单面
    MyBatis(四)映射文件 之 备用4
    MyBatis(四)映射文件 之 resultMap:鉴别器
    MyBatis(四)映射文件 之 分步查询与懒加载
    MyBatis(四)映射文件 之 备用1
    MyBatis(四)映射文件 之 注解开发
    MyBatis(四)映射文件 之 一对多映射查询
    MyBatis(四)映射文件 之 多对一映射查询
    MyBatis(四)映射文件 之 resultMap 自定义映射
    MyBatis(四)映射文件 之 resultType 自动映射
  • 原文地址:https://www.cnblogs.com/ipetergo/p/6343613.html
Copyright © 2020-2023  润新知