无法解决以下工件:javax.sql:jdbc-stdext:jar:2.0,javax.transaction:jta:jar:1.0.1B:

时间:2019-07-17 10:24:54

标签: java maven

使用Maven构建应用程序时出现以下错误。

  

无法解析以下工件:javax.sql:jdbc-stdext:jar:2.0,javax.transaction:jta:jar:1.0.1B:找不到javax.sql:jdbc-stdext:jar https://repo.maven.apache.org/maven2中的:2.0已缓存在本地存储库中,直到中心的更新间隔过去或强制进行更新-> [帮助1]

我尝试在pom.xml中包含javax.sql:jdbc-stdext。但这也不起作用

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>com.dpxpay</groupId>
    <artifactId>uTransfercore</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>uTransfercore</name>
    <description>uTransfer_core</description>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

    </build>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jcs/jcs -->
        <dependency>
            <groupId>jcs</groupId>
            <artifactId>jcs</artifactId>
            <version>1.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.12</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.struts.xwork</groupId>
            <artifactId>xwork-core</artifactId>
            <version>2.3.35</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-core -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.3.35</version>
        </dependency>

    </dependencies>


    <packaging>jar</packaging>
</project>

我希望它能成功运行。但是显示错误。

能否请您指出我做错了什么?我是Maven的新手。预先感谢。

2 个答案:

答案 0 :(得分:0)

尝试为mysql-connector添加依赖项:

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.16</version>
        </dependency>

此依赖项用作jcs:jcs:1.3

的传递性依赖项

答案 1 :(得分:0)

将jcs依赖项更改为以下内容并起作用。

<dependency>
  <groupId>org.apache.jcs</groupId>
  <artifactId>jcs</artifactId>
  <version>1.3</version>
</dependency>

还添加了对javax.servlet的依赖性