MAVEN--本地jar打包

我会带着你远行 2022-05-16 07:28 332阅读 0赞

Maven打包

在开发项目的时候,使用了第三方公司提供的jar包,只能引用器jar包。开发时候使用
<systemPath>${project.basedir}/lib/dcms-mq-client-1.0-SNAPSHOT.jar</systemPath> 进行引用,当打包时候 不成功,因此需要更改为
<systemPath>${pom.basedir}/lib/dcuc-client.jar</systemPath>
再次即可成功。(示例如下)

示例

  1. <dependency>
  2. <groupId>com.houshuai</groupId>
  3. <artifactId>houshuai</artifactId>
  4. <version>1.0-SNAPSHOT</version>
  5. <scope>system</scope>
  6. <systemPath>${pom.basedir}/lib/dcms-mq-client-1.0-SNAPSHOT.jar</systemPath>
  7. <type>jar</type>
  8. <optional>true</optional>
  9. </dependency>

插件配置

由于采用SpringBoot 进行 。则在插件中增加
<includeSystemScope>true</includeSystemScope> 则可以成功导入本地jar包。

  1. <plugins>
  2. <plugin>
  3. <groupId>org.springframework.boot</groupId>
  4. <artifactId>spring-boot-maven-plugin</artifactId>
  5. <configuration>
  6. <executable>true</executable>
  7. <includeSystemScope>true</includeSystemScope>
  8. </configuration>
  9. </plugin>
  10. </plugins>

发表评论

表情:
评论列表 (有 0 条评论,332人围观)

还没有评论,来说两句吧...

相关阅读

    相关 maven打包加入本地jar

        maven项目在开发的时候,有时候,并不是所有的依赖都可以在远程仓库能够获取到,只能是在一些网站下载没有推到公共仓库的jar文件,然后加入到工程的buildpath中,