maven打包包含本地jar包

maven打包記錄

包含本地jar包
全局只修改pom.xml即可

添加依賴

1、groupId隨便填
2、artifactId隨便填
3、version隨便填
4、scope填system
5、systemPath填jar包路徑,${project.basedir}爲當前項目路徑

<dependency>
            <groupId>xxx</groupId>
            <artifactId>aaa</artifactId>
            <version>1.0.3</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/xxx/aaa.jar</systemPath>
        </dependency>

添加插件

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

添加包含jar包

<resources>
            <resource>
                <directory>lib</directory>
                <targetPath>/BOOT-INF/lib/</targetPath>
                <includes>
                    <include>**/*.jar</include>
                </includes>
            </resource>
        </resources>
發佈了42 篇原創文章 · 獲贊 4 · 訪問量 4659
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章