You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maven项目中Missing artifact com.oracle:ojdbc6:jar:11.1.0.7.0问题求助

Fixing the "Missing artifact com.oracle:ojdbc6:jar:11.1.0.7.0" Error in STS

Hey there, let’s work through this annoying Maven artifact error together—I’ve dealt with this exact issue when working on Spring projects in STS, so I know how stuck you feel right now. The core problem here is that Oracle restricts distribution of its JDBC drivers, so they aren’t available in public Maven repositories. Let’s walk through the step-by-step fix that always works for me:

Step 1: Download the Correct ojdbc6 Jar File

First, you’ll need to grab the exact ojdbc6.jar version 11.1.0.7.0 from Oracle’s official download page. Note that you’ll need an Oracle account to access the download (it’s free to create one if you don’t have it). Make sure you pick the jar that matches your version exactly—don’t substitute with a newer one, since that’ll cause version mismatches.

Step 2: Install the Jar to Your Local Maven Repository

Once you have the jar file, open your terminal (or command prompt) and run this Maven command, replacing path/to/ojdbc6.jar with the actual file path on your computer:

mvn install:install-file -Dfile=path/to/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jar

Let me break down what each part does:

  • -Dfile: Points to the location of your downloaded ojdbc6 jar
  • -DgroupId, -DartifactId, -Dversion: Matches the artifact coordinates in your pom.xml that’s throwing the error
  • -Dpackaging: Specifies that this is a jar file

Wait for the command to finish successfully—you should see a "BUILD SUCCESS" message when it’s done.

Step 3: Refresh Your Maven Project in STS

Now head back to STS:

  1. Right-click your Spring project in the Package Explorer
  2. Hover over Maven and select Update Project...
  3. In the pop-up window, check the box for Force Update of Snapshots/Releases (this ensures Maven picks up the newly installed jar)
  4. Click OK and wait for STS to refresh the project dependencies

Step 4: Double-Check Your pom.xml Dependency

Make sure your pom.xml has the exact dependency entry that matches the coordinates you used in the install command:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.1.0.7.0</version>
</dependency>

If you had any third-party repository entries added earlier (from those StackOverflow posts you tried), you can remove them now—they won’t help here since the jar is now in your local repo.

Quick Troubleshooting Tip

If you still see the error after these steps, check that STS is using the correct Maven settings:

  • Go to Window > Preferences > Maven > User Settings
  • Verify that the User Settings path points to your Maven settings.xml file (this should be the same one that’s linked to your local repository where you installed the jar)

That should resolve the missing artifact error—let me know if you hit any snags along the way!

内容的提问来源于stack exchange,提问作者Chandan Vishwakarma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:37:48