我是智能想法的新手。

我正在尝试添加一个依赖项(例如)jcl-over-slf4:jar,但未添加它,这是日志中的错误。

017-12-02 14: 40: 41,903 [6473161] INFO - # org.jetbrains.idea.maven - org.apache.maven.project.ProjectBuildingException: some problems occurred while processing POM:
[ERROR] 'dependencies.dependency.groupId' for: jcl-over-slf4: jar is missing. @line 31, column 16


我关闭了Idea并删除了.IntelliJIdea14 \ system \ Maven \ Indices中的所有内容,并清除了整个.m2 \ repository目录

重新启动Idea,并在设置中尝试连接到中央Maven存储库,但是第一次加载缓慢。现在它根本不加载
enter image description here

我打开了自动导入功能,并关闭了防火墙和防病毒软件。允许访问互联网。设置VM选项-Xmx1024m,但问题仍然存在。
enter image description here
但是.m2 /存储库文件夹的大小仅为27 MB(您需要270 MB)。

版本14.1.6的想法。

这是我的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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>spring</groupId>
  <artifactId>spring-test-app</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>spring-test-app Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>4.3.11.RELEASE</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
        <version>4.3.11.RELEASE</version>
    </dependency>

      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4</artifactId>
      </dependency>
  </dependencies>
  <build>
    <finalName>spring-test-app</finalName>
  </build>
</project>


我还应该怎么做才能加载所有依赖项?

最佳答案

向您的依赖项添加一个版本,例如

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>jcl-over-slf4j</artifactId>
   <version>1.7.25</version>
</dependency>

09-30 13:09
查看更多