无法在使用apache camel的maven项目中解析导入org.apache.commons.dbcp2

eyh26e7m  于 2022-11-07  发布在  Apache
关注(0)|答案(1)|浏览(314)

我尝试在Eclipse IDE中使用apache camel连接到PostgreSQL数据库,但是我收到此错误:无法解析导入org.apache.commons.dbcp2
导入时:数据库管理系统.
这些是POM中的相关性:

<dependencies>

    <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-jdbc</artifactId>
    <version>${camel.version}</version>
    <!-- use the same version as your Camel core version -->
</dependency>

    <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-servlet</artifactId>
    <version>${camel.version}</version>

</dependency>

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-servlet-starter</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-http-common</artifactId>
    <version>${camel.version}</version>
</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-spring-boot-starter</artifactId>
            <version>${camel.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

我不知道该怎么办,感谢任何帮助!

k5hmc34c

k5hmc34c1#

通过添加以下依赖项解决了问题:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-dbcp2</artifactId>
    <version>2.9.0</version>
</dependency>

相关问题