Springboot将jar包添加到本地maven仓库中及jar包指定编码启动

137 阅读1分钟

1.maven命令将jar包指定到本地仓库中

将第三个jar包添加到本地maven仓库中,具体命令如下:

mvn install:install-file -Dfile=F:\workspace\xxProject\infoInteractive-push\cbb-ops\cbb-app-server\lib\commons-lang-2.4.jar -DgroupId=com.commons.lang -DartifactId=commons -Dversion=1.0.0.1 -Dpackaging=jar

提示Dfile=指向具体需要引入本地jar包路径,DgroupId: 自定义groupId名称,DartifactId:自定义artifactId名称,Dversion:版本号 pom.xml引入

<!-- StringUtils相关-->
        <dependency>
            <groupId>com.commons.lang</groupId>
            <artifactId>commons</artifactId>
            <version>1.0.0.1</version>
<!--            <scope>system</scope>-->
<!--            <systemPath>${pom.basedir}/src/main/resources/lib/commons-lang-2.4.jar</systemPath>                  &lt;!&ndash; lib文件夹下的路径 &ndash;&gt;-->
        </dependency>

2.jar包指定utf8编码启动

java -Dfile.encoding=utf-8 -jar 包名.jar