美文网首页
Maven所依赖的包

Maven所依赖的包

作者: 大炮对着虫子 | 来源:发表于2017-12-10 17:08 被阅读6次

中央仓库:

 <!-- 配置中央仓库 -->
  <repositories>
    <repository>
        <id>mvnrepository</id>
        <url>http://mvnrepository.com/</url>
    </repository>
  </repositories>

配置编译运行环境:

  <!-- 配置属性值 -->
  <properties>
    <jdk.version>1.7</jdk.version>
    <charset>utf-8</charset>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>4.1.0.RELEASE</spring.version> 
  </properties>
  

 <!-- 配置插件信息 -->
  <build>
    <plugins>
        <!-- 工程编译插件 ;指定使用的jdk的版本-->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>${jdk.version}</source>
                <target>${jdk.version}</target>
                <encoding>${charset}</encoding>
            </configuration>
        </plugin>
    </plugins>
  </build>

web三剑客:

<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.servlet/jsp-api -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
    <scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/jstl -->
<dependency>
    <groupId>javax.servlet
    </groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

数据库驱动


<!-- mysql数据库驱动jar -->
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.32</version>
    </dependency>

单元测试

 <!-- 配置依赖信息 -->
  <dependencies>
    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

spring配置:

  <!-- 配置属性值 -->
  <properties>
    <jdk.version>1.7</jdk.version>
    <charset>utf-8</charset>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>4.1.0.RELEASE</spring.version> 
  </properties>


<!-- 配置spring的jar的依赖信息 -->
    <!-- spring测试模块的jar -->
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
        <!-- <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
        </exclusions> -->
    </dependency>
    
    <!-- spring的核心容器模块的jar;beans  core  context  expressionlanguage -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</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-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-expression</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-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>

            <!-- 事务控制的jar包的依赖信息 -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

    <!-- jdbcTemplate的jar的依赖信息 -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

数据库连接池druid

<!-- 数据库连接池的jar的包依赖信息 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.23</version>
        </dependency>

jdbcTemplate结合druid连接池在spring容器的配置

springMVC:

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1.1</version>
        </dependency>

相关文章

网友评论

      本文标题:Maven所依赖的包

      本文链接:https://www.haomeiwen.com/subject/gflsuxtx.html