zoukankan      html  css  js  c++  java
  • 使用maven下载jar包

    1、建一个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/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.companny.maven</groupId>
      <artifactId>hello</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <!-- 添加依赖 -->
      <dependencies>
       <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
       </dependency>
      </dependencies>
    </project>

    2、在该pom.xml所在目录:

    cmd下:输入以下命令:

    mvn dependency:copy-dependencies

    3、下载完成后的jar在dependency的目录下

    4、将下载的jar包加入仓库:

                                                                   下载的jar路径                                                         参数2                 参数3                版本

    mvn install:install-file -Dfile="c:\javaee\hello\target\dependency\junit-4.12.jar" -DgroupId=junit -DartifactId=junit -Dversion=4.12 -Dpackaging=jar

  • 相关阅读:
    计算长度的方法
    自动装箱和拆箱
    基本数据包装类
    Date类
    文档参数解析
    权限修饰符
    IO流
    ArrayList集合类
    对象数组
    二维数组
  • 原文地址:https://www.cnblogs.com/ciscolee/p/15707524.html
Copyright © 2011-2022 走看看