我刚开始使用m2e来尝试构建示例travellog弹性beanstalk项目。在控制台上,我收到“[ERROR]项目读取错误”。
这在“依赖关系层次结构”选项卡上也显示为红色。
这意味着什么?如何找到更多详情?
编辑:添加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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BeanstalkTest</groupId>
<artifactId>BeanstalkTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>[1.0.007,)</version>
</dependency>
</dependencies>
</project>
答案 0 :(得分:22)
确定。所以我想我明白了。
在workspace \ .metadata中有日志文件,例如.log mine有这个条目:
!ENTRY org.eclipse.m2e.logback.appender 4 0 2012-05-28 18:50:44.641
!MESSAGE Project read error
你可以查看:
工作空间\ .metadata位于\ .plugins \ org.eclipse.m2e.logback.configuration
找到m2e的日志文件,例如0.log
这些非常详细和有用。无论如何,我的日志文件有这个条目:
2012-05-28 18:50:44,640 [Worker-52] ERROR o.e.m.editor.pom.DependencyTreePage - Project read error
org.eclipse.core.runtime.CoreException: Project read error
at org.eclipse.m2e.core.embedder.MavenModelManager.readDependencyTree(MavenModelManager.java:230) ~[na:na]
at org.eclipse.m2e.editor.pom.MavenPomEditor.readDependencyTree(MavenPomEditor.java:701) ~[na:na]
at org.eclipse.m2e.editor.pom.DependencyTreePage$1.run(DependencyTreePage.java:215) ~[na:na]
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [org.eclipse.core.jobs_3.5.101.v20120113-1953.jar:na]
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [com.amazonaws:aws-java-sdk:jar:[1.0.007,) (compile)]
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:262) ~[na:na]
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:345) ~[na:na]
at org.eclipse.m2e.core.embedder.MavenModelManager.readDependencyTree(MavenModelManager.java:226) ~[na:na]
... 3 common frames omitted
Caused by: org.sonatype.aether.resolution.VersionRangeResolutionException: Failed to resolve version range for org.codehaus.jackson:jackson-mapper-asl:jar:[1.8.): Invalid version range [1.8.), single version must be surrounded by []
at org.apache.maven.repository.internal.DefaultVersionRangeResolver.resolveVersionRange(DefaultVersionRangeResolver.java:114) ~[na:na]
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:378) ~[na:na]
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:533) ~[na:na]
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:243) ~[na:na]
... 5 common frames omitted
Caused by: org.sonatype.aether.version.InvalidVersionSpecificationException: Invalid version range [1.8.), single version must be surrounded by []
at org.sonatype.aether.util.version.GenericVersionRange.<init>(GenericVersionRange.java:84) ~[na:na]
at org.sonatype.aether.util.version.GenericVersionScheme.parseVersionRange(GenericVersionScheme.java:40) ~[na:na]
at org.sonatype.aether.util.version.GenericVersionScheme.parseVersionConstraint(GenericVersionScheme.java:66) ~[na:na]
at org.apache.maven.repository.internal.DefaultVersionRangeResolver.resolveVersionRange(DefaultVersionRangeResolver.java:109) ~[na:na]
... 8 common frames omitted
因此,似乎aws-java-sdk依赖项的定义存在问题。它指定jackson-mapper-asl可以是版本[1.8。),这似乎是无效的语法。
如果我修改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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BeanstalkTest</groupId>
<artifactId>BeanstalkTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>[1.0.007,)</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
这不会产生“项目读取错误”。所以,基本上有两件事:
谢谢卢卡。