我正在尝试将STS项目连接到oracle数据库。
我已将依赖项添加到pom.xml。
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>11.2.0.2</version>
</dependency>
我收到以下错误; Missing artifact com.oracle:ojdbc5:jar:11.2.0.2
我已将以下文件下载到C:\ Users \ 10022294 \ Downloads \
我运行了以下命令;
C:\Users\10022294\Documents\workspace-spring\H2InMemoryDbDemo>mvnw install:install-file -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.2.0 -Dpackaging=jar -Dfile=C:\Users\10022294\Downloads\ojdbc5-11.2.0.2.0.jar
运行命令时出现的错误是:
C:\Users\10022294\Documents\workspace-spring\H2InMemoryDbDemo>mvnw install:install-file -DgroupId=com.oracle -DartifactI d=ojdbc5 -Dversion=11.2.0.2.0 -Dpackaging=jar -Dfile=C:\Users\10022294\Downloads\ojdbc5 11.2.0.2.0.jar
Found "C:\Users\10022294\Documents\workspace-spring\H2InMemoryDbDemo\.mvn\wrapper\maven-wrapper.jar"
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:73)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:60)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:64)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:55)
我认为这可能与我的公司代理有关。我已将*.java.net;*.sun.net;*.apache.org
添加到代理例外中,但仍然无法正常工作。
还有另一种安装ojdbc5工件的方法吗?