Add external library .jar to Spring boot .jar internal /lib

前端 未结 7 1356
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 23:04

I have an external .jar that cannot be imported from public repositories using pom.xml, it\'s sqljdbc41.jar.

I can run the project locally from my IDE,

7条回答
  •  被撕碎了的回忆
    2020-11-29 23:40

    You could install the sqljdbc41.jar in your local repository :

    mvn install:install-file -Dfile=path/to/sqljdbc41.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc41 -Dversion=4.1 -Dpackaging=jar
    

    And then declare the dependency as a standard dependency :

    
       com.microsoft.sqlserver
       sqljdbc41
       4.1
    
    

    If you use a remote artifact repository (nexus, archiva...) you also need to deploy the artifact on this repository. You can find more here : https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html

提交回复
热议问题