Add the Oracle JDBC driver to the Maven Repository
Due to Oracle authorization problems, Maven3 does not provide Oracle JDBC driver. To Apply Oracle JDBC driver to Maven projects, you must manually add the driver to the local repository.
1. Obtain the Oracle JDBC Driver
1. Download the appropriate version: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html from the Oracle Official Website
2. The installation directory of Oracle is obtained at "{ORACLE_HOME} \ jdbc \ lib \ ojdbc14.jar"
2. Manual installation and Installation
For manual installation, refer to another article: Maven3 manually install local jar to the repository
Or run the following command:
Mvn install: install-file-Dfile = {Path/to/your/ojdbc. jar}-DgroupId = com. oracle-DartifactId = ojdbc6-Dversion = 11.2.0-Dpackaging = jar
3. After installation, add references to the pom. xml file.
<Dependencies>
<! -- Add oracle jdbc driver -->
<Dependency>
<GroupId> com. oracle </groupId>
<ArtifactId> ojdbc14 </artifactId>
<Version> 10.2.0.4.0 </version>
</Dependency>
</Dependencies>
Okay, you can reference it normally.
Maven official guide _ Chinese full version clear PDF
Maven 3.1.0 release, Project Build Tool
Install Maven in Linux
Maven3.0 configuration and simple use
Set up sun-jdk and Maven2 in Ubuntu
Get started with Maven
This article permanently updates the link address: