springboot 添加本地jar包依赖

作者: yellow_han | 来源:发表于2018-08-15 08:58 被阅读138次
    <dependency>
        <groupId>dayu.api</groupId>
        <artifactId>dayu-api</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>
            ${project.basedir}/src/main/resources/lib/dayu-api-1.0.0.jar
        </systemPath>
    </dependency>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

    如果要打成war包

    <plugins>
        <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-war-plugin</artifactId>
             <configuration>
                <webResources>
                     <resource>
                      <directory>src/main/resources/libs</directory>
                      <targetPath>WEB-INF/lib/</targetPath>
                      <includes>
                         <include>**/*.jar</include>
                       </includes>
                     </resource>
                </webResources>
                </configuration>
        </plugin>
    
    </plugins>

    相关文章

      网友评论

        本文标题:springboot 添加本地jar包依赖

        本文链接:https://www.haomeiwen.com/subject/rzribftx.html