<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.cloudst</groupId>
<artifactId>cloudst</artifactId>
<version>0.1.2</version>
<packaging>jar</packaging>
<name>cloudst</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>com.springsource.repository.bundles.release</id>
<url>http://repository.springsource.com/maven/bundles/release/</url>
</repository>
<repository>
<id>EclipseLink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>
<repository>
<id>java.net2</id>
<name>Repository hosting the jee6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.kitchen-eel</groupId>
<artifactId>json-schema-validator</artifactId>
<version>${kitchen-eel.version}</version>
</dependency>
<build>
<finalName>cloudst</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</build>
</project>
能够使用标准mvn命令从命令行成功清理,编译和安装此项目......
但是,在Eclipse Juno的“问题”窗格中,我有以下2个错误:
缺少工件org.kitchen-eel:json-schema-validator:jar:1.2.1 pom.xml /com.cloudst line 45 Maven依赖问题
ArtifactTransferException:无法传输org.kitchen-eel:json-schema-validator:jar:1.2.1
被缓存在本地存储库中, 在中心的更新间隔之前,不会重新尝试解析 已过去或更新被强制。原始错误:无法传输工件 org.kitchen-eel:json-schema-validator:jar:1.2.1 from / to central (http://repo.maven.apache.org/maven2):
为什么它在命令行中有效,但是m2eclipse会发布问题?
感谢您花时间阅读此内容......
答案 0 :(得分:21)
这是解决Eclipse中Maven项目中可能出现的错误“ArtifactTransferException:无法传输工件”的非常简短的提示。
要解决的步骤:
1. Open folder by running this text (without Quotes) in Search Explorer of Window “%USERPROFILE%\.m2″.
2. After running above command, “m2″ folder of maven will open. Now search for file (without Quotes) “*.lastUpdated”.
3. In this step, delete all the files found by running Step 2.
4. Now go to Eclipse project and select “Maven | Update Dependency” or “Maven | Update Project”.
快乐编码。
答案 1 :(得分:1)
如果您为所有 new 工件发生此类连接错误:m2eclipse默认使用嵌入式Maven实例,而不是外部Maven安装。内部Maven实例可能不会使用与外部Maven实例相同的Maven设置(例如%USERPROFILE%/。m2 / settings.xml),这可能导致内部Maven实例无法通过您的代理连接。
您可以使用Eclipse首选项添加外部Maven安装,并将其用于从Eclipse内部运行Maven命令。
答案 2 :(得分:1)
这是我的解决方案。
找到发生错误的jar库并从.m2 repo中删除。然后使用m2eclipse更新项目。它对我有用。