maven项目pom文件引入本地jar包并打包的配置


一、将jar包拷贝到项目文件夹响应位置,一般放到/src/main/webapp下
二、在pom.xml文件中加入以下标签内容
<dependency>
   <groupId>credibledata</groupId>
   <artifactId>credibledata</artifactId>
   <version>2.1</version>
   <scope>system</scope>
   <systemPath>${project.basedir}/src/main/webapp/credibledata-envelop-1.0-SNAPSHOT.jar</systemPath>
</dependency>

<dependency>
   <groupId>jdk15on</groupId>
   <artifactId>jdk15on</artifactId>
   <version>2.1</version>
   <scope>system</scope>
   <systemPath>${project.basedir}/src/main/webapp/bcprov-jdk15on-1.57.jar</systemPath>
</dependency>

三、在pom.xml文件的<build>标签的子标签<plugins>的子标签<plugin>下加入如下标签配置

<configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>

如图所示,是添加后的配置

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

第三步是为了能让本地引入的jar包在打包时可以打到jar里去。


					


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM