每日一记8.22

Maven 打包时引用项目中lib目录下的jar文件

<dependency>
    <groupId>xxxxxxxx</groupId>
    <artifactid>xxxxxxx</artifactid>
    <version>2.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/lib/xxxxxx-2.0.jar</systemPath>
</dependency>
 
在plugins中添加 plugin 如:
<plugin>
    <groupid>org.springframework.boot</groupId>
    <artifactid>spring-boot-maven-plugin</artifactid>
    <configuration>
        <includeSystemScope>true</includeSystemScope>
    </configuration>
 
</plugin>

Maven 打包时引用项目中lib目录下的war文件

<dependency>
    <groupId>xxxxxxxx</groupId>
    <artifactid>xxxxxxx</artifactid>
    <version>2.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/lib/xxxxxx-2.0.jar</systemPath>
</dependency>

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <warSourceExcludes>src/main/resource/**</warSourceExcludes>   <warName>XXXX</warName>   <webResources>   <resource>   <directory>${project.basedir}/src/main/resources/lib</directory>              <targetPath>WEB-INF/lib</targetPath>    <filtering>true</filtering> <includes>   <include>**/*.jar</include> </includes> </resource> </webResources> </configuration> </plugin>

 

posted @ 2019-08-22 10:33  sunshine-2018  阅读(106)  评论(0编辑  收藏  举报