1. Background
For some specific reasons, the required version of the jar file cannot be downloaded in the remote maven repository, and the local jar file needs to be referenced in maven.
Two, the solution
1. Create the libs directory
In order to facilitate jar package management, you can create a libs directory at the same level as the src directory in the project directory. as follows:
2. The project module introduces dependencies
1)File --> Project Structure --> Modules --> Dependices --> 添加 JARs or Directories
2) Select the jar file that needs to be referenced
3)Apply --> OK
3. Add pom reference
as follows:
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc15</artifactId>
<version>10.2.0.4.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/ojdbc15-10.2.0.4.0.jar</systemPath>
</dependency>
</dependencies>