本地打jar包到本地maven

参考 https://www.cnblogs.com/zhanghj405/p/5599635.html

在有sqljdbc4.jar包的文件夹下,通过shift+右键的方式--》此处打开命令窗口,然后执行以下maven命令

 mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0  

  命令解释:mvn install:install-file -Dfile="jar包的绝对路径" -Dpackaging="文件打包方式" -DgroupId=groupid名 -DartifactId=artifactId名 -Dversion=jar版本 

Step 3

  在pom.xml中引入本地jar包

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
</dependency>

==================================================================================================================================

参考jsch本地的打包    https://github.com/nivance/ssh2-spring-boot 
具体如下: 

要将项目ssh-spring-boot放到任何maven公共仓库,所以需要将ssh-spring-boot的jar包安装到本地repository中。

cd ssh-spring-boot  //项目路径

mvn clean install  //先把项目打包

cd jsch-spring-boot/jsch-spring-boot-starter/target

mvn install:install-file -Dfile=jsch-spring-boot-starter-1.0.1.jar -DgroupId=ssh2.spring.boot -DartifactId=jsch-spring-boot-starter -Dversion=1.0.1 -Dpackaging=jar
	
cd ../../jsch-spring-boot-autoconfigure/target

mvn install:install-file -Dfile=jsch-spring-boot-autoconfigure-1.0.1.jar -DgroupId=ssh2.spring.boot -DartifactId=jsch-spring-boot-autoconfigure -Dversion=1.0.1 -Dpackaging=jar
<dependency>
	<groupId>ssh2.spring.boot</groupId>
	<artifactId>jsch-spring-boot-starter</artifactId>
	<version>1.0.1</version>
</dependency>

猜你喜欢

转载自www.cnblogs.com/zk1023/p/9332450.html
今日推荐