Java Intellij Idea需要花很长时间来解决maven依赖关系
我正在使用intellij idea ultimate版本12.1.4,并尝试在项目中使用maven。以下是我的pom.xml:Java Intellij Idea需要花很长时间来解决maven依赖关系,java,maven,intellij-idea,Java,Maven,Intellij Idea,我正在使用intellij idea ultimate版本12.1.4,并尝试在项目中使用maven。以下是我的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
<?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>
<parent>
<groupId>com.fasterxml</groupId>
<artifactId>oss-parent</artifactId>
<version>10</version>
</parent>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.2</version>
<name>jackson-databind</name>
<description>General data-binding functionality for Jackson: works on core streaming API</description>
<url>http://wiki.fasterxml.com/JacksonHome</url>
<scm>
<connection>scm:git:git@github.com:FasterXML/jackson-databind.git</connection>
<developerConnection>scm:git:git@github.com:FasterXML/jackson-databind.git</developerConnection>
<url>http://github.com/FasterXML/jackson-databind</url>
<tag>jackson-databind-2.2.2</tag>
</scm>
<properties>
<osgi.export>
com.fasterxml.jackson.databind,
com.fasterxml.jackson.databind.annotation,
com.fasterxml.jackson.databind.cfg,
com.fasterxml.jackson.databind.deser,
com.fasterxml.jackson.databind.deser.impl,
com.fasterxml.jackson.databind.deser.std,
com.fasterxml.jackson.databind.exc,
com.fasterxml.jackson.databind.ext,
com.fasterxml.jackson.databind.introspect,
com.fasterxml.jackson.databind.jsonschema,
com.fasterxml.jackson.databind.jsonFormatVisitors,
com.fasterxml.jackson.databind.jsontype,
com.fasterxml.jackson.databind.jsontype.impl,
com.fasterxml.jackson.databind.module,
com.fasterxml.jackson.databind.node,
com.fasterxml.jackson.databind.ser,
com.fasterxml.jackson.databind.ser.impl,
com.fasterxml.jackson.databind.ser.std,
com.fasterxml.jackson.databind.type,
com.fasterxml.jackson.databind.util
</osgi.export>
<osgi.import>
com.fasterxml.jackson.annotation,
com.fasterxml.jackson.core,
com.fasterxml.jackson.core.base,
com.fasterxml.jackson.core.format,
com.fasterxml.jackson.core.json,
com.fasterxml.jackson.core.io,
com.fasterxml.jackson.core.util,
com.fasterxml.jackson.core.type,
org.xml.sax,org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.ls,
javax.xml.datatype, javax.xml.namespace, javax.xml.parsers
</osgi.import>
<!-- Generate PackageVersion.java into this directory. -->
<packageVersion.dir>com/fasterxml/jackson/databind/cfg</packageVersion.dir>
<packageVersion.package>com.fasterxml.jackson.databind.cfg</packageVersion.package>
</properties>
<dependencies>
<!-- Builds on core streaming API; also needs core annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.2</version>
</dependency>
<!-- and for testing, JUnit is needed, as well as quite a few
libs for which we use reflection for code, but direct dep for testing
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.7.9</version>
<scope>test</scope>
</dependency>
<dependency> <!-- from core we just test for repackaged cglib, not hibernate proper -->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-cglib-repack</artifactId>
<version>2.1_3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<excludes>
<exclude>com/fasterxml/jackson/failing/*.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
<links>
<link>http://docs.oracle.com/javase/6/docs/api/</link>
<link>http://fasterxml.github.com/jackson-annotations/javadoc/2.1.1/</link>
<link>http://fasterxml.github.com/jackson-core/javadoc/2.1.1/</link>
</links>
</configuration>
</plugin>
<plugin>
<!-- Inherited from oss-base. Generate PackageVersion.java.-->
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>process-packageVersion</id>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<properties>
<maven.test.skip>true</maven.test.skip>
<skipTests>true</skipTests>
</properties>
</profile>
</profiles>
</project>
4.0.0
com.fasterxml
所以请回答
请让我知道我哪里做错了,我如何摆脱它
编辑
如果这有帮助,我将尝试运行以下代码:
我不确定pom.xml本身是否有问题。如果有人能够让它在他的IDE上工作,可能会得出结论,这是我的特定IDE配置的问题。如果这是intellij的特定问题,我建议执行以下步骤
您可以尝试运行mvn clean install(取决于您的网络速度,它将提取每个依赖项)
在中更改intellij设置
首选项->构建、执行、部署->maven->maven主目录->{现在将其更改为指向您的mvn主目录,而不是绑定的mvn}
命令行中的mvn-v应该为您提供maven主路径。
现在它不再尝试下载依赖项
文件|设置|构建、执行、部署|构建工具| Maven|
线程(-T选项)| 8(或您想要尝试的线程数)
我也有同样的问题。Maven在IntelliJ上花了一个小时,也在命令行上运行。使用-T参数可以告诉Maven使用更多线程来同时下载工件。现在只需要大约15分钟
不要使用捆绑的mvn。将“Maven主目录”指向文件系统上的路径
在你完成建造之后。选中“脱机工作”。这将阻止mvn在每次构建时搜索远程网站。更新POM文件时取消选中,以便它可以搜索更改
您也可以跳过测试。这是命令行中的所有内容
mvn clean install -T 8 -o -DskipTests
您的小屏幕截图中的文件名指示器是否发生过变化?@specializet我希望您是在谈论第一个屏幕截图。它的进度条不断地左右移动。没有任何变化。它停留在jackson-databind-2.2.2.jar。你有代理吗?@EdwinDalorzo没有。如果你从命令行运行maven,它工作正常吗?还是它也结冰了?我认为这是一个与IntelliJ相关的问题还是一个与maven相关的问题是值得了解的。您使用哪个处理器?Intel Xeon E3-158L。所有远程请求都需要时间,而不是处理器。不确定20是不是最佳数量。也许4号更好。我会试试@Philip!
mvn clean install -T 8 -o -DskipTests