zoukankan      html  css  js  c++  java
  • Maven中安装本地Jar包到仓库中或将本地jar包上传

    摘要

      maven install 本地jar

    命令格式

    mvn install:install-file -DgroupId=<group_name> -DartifactId=<artifact_name> -Dversion=<version_no> -Dfile=<path_of_the_local_jar> -Dpackaging=jar -DgeneratePom=true

    示例

    mvn install:install-file -DgroupId=com.qrcode -DartifactId=qrcode -Dversion=1.0 -Dfile=e:/test/QRCode.jar -Dpackaging=jar -DgeneratePom=true

    添加依赖

      <dependency>
            <groupId>com.qrcode</groupId>
            <artifactId>qrcode</artifactId>
            <version>1.0</version>
        </dependency>

    本地jar包上传

      1.使用命令行

      

    mvn deploy:deploy-file -DgroupId=com.hjz -DartifactId=hujunzheng -Dversion=0.0.1 -Dpackaging=jar -Dfile=jar包绝对路径 -Durl=http:xxx/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

      DgroupId和DartifactId构成了该jar包在pom.xml的坐标,项目就是依靠这两个属性定位。自己起名字也行。

      Dfile表示需要上传的jar包的绝对路径。

      Durl私服上仓库的位置,打开nexus——>repositories菜单,可以看到该路径。

      DrepositoryId服务器的表示id,在nexus的configuration可以看到。

      Dversion表示版本信息,怎样得到一个jar包准确的版本呢?

      解压该包,会发现一个叫MANIFEST.MF的文件,这个文件就有描述该包的版本信息。

      比如Manifest-Version: 1.0可以知道该包的版本了。

      

      2.通过eclipse

  • 相关阅读:
    js向下取整的奇技淫巧
    Python 中文Key 报错问题
    [LintCode] Palindrome Partitioning II
    [LintCode] Trapping rain water II
    [LintCode] Trapping Rain Water
    [LintCode] Permuation Index
    [LintCode] Word Break
    [LintCode] Interleaving Positive and Negative Numbers
    [LintCode] Find the Weak Connected Component in the Directed Graph
    [LintCode] Binary Tree Serialization
  • 原文地址:https://www.cnblogs.com/hujunzheng/p/5659410.html
Copyright © 2011-2022 走看看