突然maven不能编译了


C:Usersnanjiang.jx>mvn -version
    Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
    Java version: 1.6.0_45
    Java home: D:Program FilesJavajdk1.6.0_45jre
    Default locale: zh_CN, platform encoding: GBK
    OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
C:Usersnanjiang.jx>java -version
    java version "1.7.0_60"
    Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
    Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

我已经使用maven在Java中开发了几天了。把项目交给别人编译就ok了。

今天,我用了一台新电脑,并像上面那样设置了环境。

当我输入MVN eclipse:eclipse时,jar被下载了,但它没有附加到。classpath。

c:idlecenter>call mvn clean eclipse:eclipse -DdownloadSources=tru
    e
    [INFO] Scanning for projects...
    [INFO] Reactor build order:
    [INFO]   idlecenter-all
    [INFO]   idlecenter-client
    [INFO]   idlecenter-dal
    [INFO]   idlecenter-server
    [INFO] Searching repository for plugin with prefix: 'eclipse'.
    [INFO] ------------------------------------------------------------------------
    [INFO] Building idlecenter-all
    [INFO]    task-segment: [clean, eclipse:eclipse]
    [INFO] ------------------------------------------------------------------------
    [INFO] [clean:clean {execution: default-clean}]
    [INFO] Preparing eclipse:eclipse
    [INFO] No goals needed for project - skipping
    [INFO] [eclipse:eclipse {execution: default-cli}]
    [INFO] Not running eclipse plugin goal for pom project
    [INFO] Using Eclipse Workspace: null
    [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN
    ER
    [INFO] ------------------------------------------------------------------------
    [INFO] Building idlecenter-client
    [INFO]    task-segment: [clean, eclipse:eclipse]
    [INFO] ------------------------------------------------------------------------
    [INFO] [clean:clean {execution: default-clean}]
    [INFO] Deleting directory I:idlecenteridlecenter-clienttarget
    [INFO] Preparing eclipse:eclipse
    [INFO] No goals needed for project - skipping
    [INFO] [eclipse:eclipse {execution: default-cli}]
    [INFO] Using Eclipse Workspace: null
    [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN
    ER
    [ERROR] An error occurred during dependency resolution of the following artifact
    :
        com.ning:compress-lzf:0.6.0
    Caused by: Unable to get dependency information: Unable to read the metadata fil
    e for artifact 'com.ning:compress-lzf:jar': Cannot find parent: org.sonatype.oss
    :oss-parent for project: com.ning:compress-lzf:bundle:0.6.0 for project com.ning
    :compress-lzf:bundle:0.6.0
      com.ning:compress-lzf:jar:0.6.0

嗯....父POM ('org.sonatype.oss:oss-parent:2')存在于主Maven仓库中。所以可能是下载时出现了暂时的问题。

查看您的本地maven repo(例如。"~/.m2/repository/…")来查看父POM是否在那里,并检查Maven是否下载了损坏的副本。(该POM文件是否与您在此页面上看到的相同?

如果它损坏了,你可以试着删除"…/org.sonatype.oss/…"子树并再次运行Maven。如果您仍然看到Maven失败,那么您可能需要检查您如何配置您的上游存储库细节,等等。

最新更新