首页 > 解决方案 > 错误:(14, 33) java: 无法访问 org.springframework.core.env.EnvironmentCapable

问题描述

我正在尝试在 uniCenta 开源 POS 版本 4.4.2 中添加 Spring Boot 支持。该版本的 uniCenta 是基于 maven 的桌面应用程序。我收到Error:(14, 33) java: cannot access org.springframework.core.env.EnvironmentCapable class file for org.springframework.core.env.EnvironmentCapable not found错误。我添加了以下依赖项:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.7.RELEASE</version>
    <relativePath/>
  </parent>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-autoconfigure</artifactId>
      <version>2.2.0.RELEASE</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency> 
      <groupId>org.springframework</groupId>  
      <artifactId>spring</artifactId>  
      <version>2.5</version>
      <scope>compile</scope>
    </dependency>  
    <dependency> 
      <groupId>org.springframework</groupId>  
      <artifactId>spring-core</artifactId>  
      <version>2.0.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.amqp</groupId>
      <artifactId>spring-amqp</artifactId>
      <version>1.1.4.RELEASE</version>
    </dependency>

<plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>

如果有人想查看完整的 POM.xml 文件,请单击此处https://github.com/MuzammalHussain6313/muzammal-ionic/blob/master/pom.xml

我还在stackoverflow答案推荐的依赖项中应用了一些更改(如依赖项范围)。

我仍然遇到同样的错误。我现在该怎么办?请帮忙。

标签: javaspringspring-bootmaven

解决方案


推荐阅读