How to add Maven dependency jar file from the lib folder

前端 未结 4 2184
悲&欢浪女
悲&欢浪女 2021-02-19 08:07

I am trying to add a jar file to the Maven dependency in my project. The settings.xml is configured to set the repository to a public repository. But this particular jar is not

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 08:22

    Have a look at system dependencies.

    You basically need to define system.

    
        ...
        
          
            javax.sql
            jdbc-stdext
            2.0
            system
            ${java.home}/lib/rt.jar
          
        
        ...
    
    

    This is if you don't have your own hosted artifact repository server such as Nexus, Artifactory or Archiva.

    If you do, then as Karl-Heinz suggested, you would be better off placing it there, as it's not good practice to commit binary artifacts to version control.

提交回复
热议问题