zoukankan      html  css  js  c++  java
  • Maven项目创建与配置(二)

    项目配置

    1:添加Source Folder

    右击项目》NEW》Source Folder

    maven规定必须创建一下几个Source Folder

    src/main/resources

    src/main/java

    src/test/resources

    src/test/java

    2:添加必要的依赖包

    2.1:添加以下依赖包httpclient、httpcore、Fastjson、Testng

    2.2:在Pom文件中配置依赖包

    <dependencies>
    <dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.7</version>
    </dependency>

    <dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.10</version>
    </dependency>

    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.10</version>
    </dependency>

    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.6.6</version>
    </dependency>

    <dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.16</version>
    </dependency>
    <dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.62</version>
    </dependency>

    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>3.8.1</version>
    <scope>test</scope>
    </dependency>

    2. 3:添加完成后可以看到Maven Dependencies出现了相关的依赖包

    3:配置Build Path

    4:设置四个文件的输出路径

    src/main/resources  对应  target/classes

    src/main/java  对应  target/classes

    src/test/resources  对应  target/test-classes

    src/test/java  对应  target/test-classes

  • 相关阅读:
    Http状态吗504问题复盘
    Http状态码502问题复盘
    Nginx服务的基本配置
    mysql修改root密码
    centos7开启80端口及其他端口
    tp5隐藏入口文件(基于nginx)
    使nginx支持pathinfo模式
    laravel-admin 上传图片过程中遇到的问题
    Maven介绍
    java中泛型
  • 原文地址:https://www.cnblogs.com/Fannfiy/p/13594343.html
Copyright © 2011-2022 走看看