• maven使用本地jar包


    引入本地jar包

    方式一:将本地Jar包安装到本地仓库,再按常规方式引用

    mvn install:install-file -Dfile=libs	ools.jar -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -DgeneratePom=true
    <dependency>
        <groupId>com.sun</groupId>
        <artifactId>tools</artifactId>
        <version>1.5.0</version>
    </dependency>

    方式二:直接添加本地依赖

    <dependency>
        <groupId>com.sun</groupId>
        <artifactId>tools</artifactId>
        <version>1.5.0</version>
        <scope>system</scope>
        <systemPath>C:/java/jdk/lib/tools.jar</systemPath>
    </dependency>

    编译时配置额外的依赖包路径

      <build>
            <plugins>
                <plugin>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <configuration>
                      <source>1.6</source>
                      <target>1.6</target>
                      <encoding>UTF-8</encoding>
                      <compilerArguments>
                           <extdirs>srcmainwebappWEB-INFlib</extdirs>
                     </compilerArguments>
                  </configuration>
                </plugin>
            </plugins>
        </build>

    将额外的本地依赖文件打到war包中

        <plugin>            
           <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-war-plugin</artifactId>             <version>2.3</version>             <configuration>                 <warName>${project.artifactId}</warName>                 <webResources>                     <resource>                         <directory>lib/</directory>                         <targetPath>WEB-INF/lib</targetPath>                         <includes>                             <include>**/*.jar</include>                         </includes>                     </resource>                 </webResources>             </configuration>         </plugin>
  • 相关阅读:
    AcWing每日一题--最大的和
    使用 *args 和 **kwargs 的含义
    Python的八大基本数据类型之 元组、列表、字典
    条件判断与if嵌套
    数据拼接与转换
    print()函数与转义字符
    BEGIN-2 序列求和
    BEGIN-1 A+B问题
    并发编程——进程——生产者消费者模型
    并发编程——进程——进程的同步与数据共享
  • 原文地址:https://www.cnblogs.com/pixy/p/4977656.html
Copyright © 2020-2023  润新知