zoukankan      html  css  js  c++  java
  • springboot项目中添加jar文件不能打包的问题

    如何引入本地jar?

    在resources目录下新建lib, 将jar复制进来

    修改pom文件

         <dependency>     
                 <groupId>com.clx.encrypt</groupId>    
                 <artifactId>encrypt.jar</artifactId>    
                 <version>1.0</version>    
                 <scope>system</scope>    
                 <systemPath>${project.basedir}/src/main/resources/lib/encrypt.jar</systemPath>    
            </dependency> 

    这样的话打包会有问题, 引入的jar不会打包进来,继续修改pom文件

    <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                                <mainClass>com.huoda.tms.SpringbootApplication</mainClass>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>com.huoda.tms.SpringbootApplication</mainClass>
                        <executable>true</executable>
                        <fork>true</fork>
                        <includeSystemScope>true</includeSystemScope>
                    </configuration>
                </plugin>
            </plugins>
            <!-- <resources>
                <resource>
                    <directory>src/main/resource</directory>
                    <includes>
                        <include>**</include>
                    </includes>
                    <filtering>false</filtering>
                </resource>
            </resources> -->
        </build>
  • 相关阅读:
    BZOJ_1712_[Usaco2007 China]Summing Sums 加密_矩阵乘法
    BZOJ_2693_jzptab_莫比乌斯反演
    BZOJ_5296_[Cqoi2018]破解D-H协议_BSGS
    BZOJ_5301_[Cqoi2018]异或序列&&CF617E_莫队
    前端开发框架对比
    现在企业流行的java框架技术
    尼古拉斯·沃斯
    算法和流程图
    Java中DAO的实现
    java中的DAO设计模式
  • 原文地址:https://www.cnblogs.com/newbest/p/11771833.html
Copyright © 2011-2022 走看看