• 本地jar添加到maven仓库中


    在pom.xml中添加依赖

    <dependency>
        <groupId>com.rxtx</groupId>
        <artifactId>rxtx-comm</artifactId>
        <version>1.0.0</version>
    </dependency>
    groupId,artifactId,version这些都是自己设置的

    maven命令将jar包移动到maven的本地repository中

    mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

    参数一
    是jar包的位置

    参数二 是在pom.xml中对应的groupId
    参数三 是在pom.xml中对应的artifactId
    参数四 是在pom.xml中对应的version

    验证方法:m2\repository 查看

    第二种方法:不把jar添加到maven本地仓库也能在maven工程下使用外部jar包

    将包htmlparser.jar放入了项目下的lib目录中
        -> ${project}/lib/htmlparser.jar
    pom.xml文件中依赖
    <dependency>
        <groupId>com.rxtx</groupId>
        <artifactId>rxtx-comm</artifactId>
        <version>1.0.0</version>
      <scope>system</scope>
      <systemPath>${project.basedir}/lib/rxtx.jar</systemPath>
    </dependency>
    
    
    
     
     
  • 相关阅读:
    微信开发之注册公众号(二)
    我开通个人博客了~~~~
    微信开发之启用开发者模式(三)
    float浮动属性
    数组的定义与特点
    块级元素和行内元素
    对于if判断和switch选择的入门理解
    Form表单
    不知名的作业
    自我介绍
  • 原文地址:https://www.cnblogs.com/chengyungzheng/p/7065950.html
Copyright © 2020-2023  润新知