日常记录问题,问题如题
解决方案
方法一,将jar包引入mavn仓库,pom引入使用
在项目的pom.xml目录下,执行cmd命令
maven下执行命令:
mvn install:install-file -Dfile=C:\xxx.jar -DgroupId=com.xx -DartifactId=1.0 -Dversion=xx -Dpackaging=jar
以上xx及版本随意填写
<dependency>
<groupId>com.xx</groupId>
<artifactId>1.0</artifactId>
<version>xx</version>
<scope>system</scope>
<systemPath>${project.basedir}/webapp/lib/xxxxx.jar</systemPath>
</dependency>
解释:
-Dfile:现在jar包所在路径
-DgroupId :项目或者组织的唯一标志
-DartifactId :项目的通用名称
-Dversion:项目版本
注意:填写内容后续引入时,pom.xml文件引入和填写内容要一致
方法二,本地引入
<dependency>
<groupId>xxxx.xxxx</groupId>
<artifactId>xxxx.xxxx</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/webapp/lib/xxxxx.jar</systemPath>
<!-- <systemPath>D:/demo/webapp/lib/xxxxx.jar</systemPath> -->
</dependency>
解释:
${project.basedir}:项目根节点的下级节点
groupId、artifactId、version:任意