导航

maven 第三方jar包分离

Posted on 2023-03-20 14:03  小强404  阅读(16)  评论(0编辑  收藏  举报

jar包依赖包分离

maven配置中build标签中引入一下组件
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <layout>ZIP</layout>
        <includes>
            <include>
                <groupId>non-exists</groupId>
                <artifactId>non-exists</artifactId>
            </include>
        </includes>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
                <goal>copy-dependencies</goal>
            </goals>
            <configuration>
                <!--target/lib是依赖jar包的输出目录,根据自己喜好配置-->
                <outputDirectory>target/lib</outputDirectory>
                <excludeTransitive>false</excludeTransitive>
                <stripVersion>false</stripVersion>
                <includeScope>runtime</includeScope>
            </configuration>
        </execution>
    </executions>
</plugin>