zoukankan      html  css  js  c++  java
  • springboot引入第三方jar方式,使用scope:system配置systemPath编译,不用添加到本地仓库!

    若是springmvc项目可参考:https://www.cnblogs.com/007sx/p/12439620.html

    项目三方jar存放位置结构:

    pom.xml中引入三方jar:

    <dependency>
        <groupId>test</groupId>
        <artifactId>testa</artifactId>
        <version>0.0.1</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/src/main/resources/lib/test.jar</systemPath>
    </dependency>

    pom.xml中的打包构建配置:

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                    <!-- 是否限制解压缩 -->
                    <executable>false</executable>
                    <mainClass>com.tuijie.gainguest.GainguestApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <!-- 用于排除三方jar包打包进入BOOT-INF/classes下(运行时是用不到的) -->
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>lib/*.jar</exclude>
                </excludes>
            </resource>
        </resources>
    </build>

    重点:

    <includeSystemScope>true</includeSystemScope>
    <excludes>
        <exclude>lib/*.jar</exclude>
    </excludes>
  • 相关阅读:
    七、Vue Cli+ApiCloud
    六、取消eslint 校验代码
    六、匿名方法
    五、vue中export和export default的使用
    四、Vue CLI-异步请求(axios)
    接口自动化测试(7)
    selenium 封装
    flask 动手写的接口平台
    flask入门篇
    python 自动化接口测试(6)
  • 原文地址:https://www.cnblogs.com/007sx/p/12442386.html
Copyright © 2011-2022 走看看