在中央(https://repo.maven.apache.org/maven2)中找不到工件javax.sql:jdbc-stdext:jar:2.0 [英] Could not find artifact javax.sql:jdbc-stdext:jar:2.0 in central (https://repo.maven.apache.org/maven2)

查看:155
本文介绍了在中央(https://repo.maven.apache.org/maven2)中找不到工件javax.sql:jdbc-stdext:jar:2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我为项目创建的Web服务构建REST API. 我的Web服务正常运行.

I'm trying to build a REST API of web Services I created for my project. My web services are working without problems.

现在,我想在远程服务器上部署我的服务,并且需要生成 war 文件.

Now, I want to Deploy my Services on a distant server and I need to generate the war file.

我正在使用Java,Eclipse和Maven进行依赖.我尝试进行全新安装,唯一的失败问题是:

I'm using Java, Eclipse and Maven for dependencies. I tried to make a clean install and the only problem of failure is that :

[WARNING] The artifact jdbc:jdbc:jar:2.0 has been relocated to javax.sql:jdbc-stdext:jar:2.0
[INFO] Downloading: https://repo.maven.apache.org/maven2/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar
Could not find artifact javax.sql:jdbc-stdext:jar:2.0 in central (https://repo.maven.apache.org/maven2), try downloading from http://java.sun.com/products/jdbc/download.html

有人解决吗?

P.S:为什么我在测试时没有遇到问题是因为我手动添加了 jdbc-stdext-2.0.jar ,但现在遇到了麻烦.

P.S : Why i didn't face the problem while testing is because I added the jdbc-stdext-2.0.jar manually and now I'm in troubles.

我的Pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Tech4EarthServices</groupId>
<artifactId>Tech4EarthServices</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <warSourceDirectory>WebContent</warSourceDirectory>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>3.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-server</artifactId>
        <version>2.17</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-servlet-core</artifactId>
        <version>2.17</version>
    </dependency>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20140107</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-json-jackson</artifactId>
        <version>2.19</version>
    </dependency>
    <dependency>
        <groupId>jdbc</groupId>
        <artifactId>jdbc</artifactId>
        <version>2.0</version>
        <exclusions>
            <exclusion>
                <artifactId>jdbc-stdext</artifactId>
                <groupId>javax.sql</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.6</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.1.7.RELEASE</version>
    </dependency>
</dependencies>

推荐答案

我相信这是因为您将工件列为pom中的排除对象.即

I believe this is because you listed the artifact as an exclusion in your pom. i.e

<exclusions>
    <exclusion>
        <artifactId>jdbc-stdext</artifactId>
        <groupId>javax.sql</groupId>
    </exclusion>
</exclusions>

我认为,如果您删除此障碍,就可以了

I think if you remove this block you will be fine

这篇关于在中央(https://repo.maven.apache.org/maven2)中找不到工件javax.sql:jdbc-stdext:jar:2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆