Maven导入指定的Jar包

1:在项目下面创建libs文件

2:在pom.xml中引入依赖

        <dependency>
            <groupId>com.XXXX</groupId>
            <artifactId>XXXX</artifactId>
            <version>16.8</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/xxx.jar</systemPath>
        </dependency>

 3:打包时,需要增加以下配置,红色字体

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

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.3</version>
            </plugin>
        </plugins>
    </build>

 

posted @ 2020-09-25 15:21  yshy  阅读(671)  评论(0编辑  收藏  举报