[英]Suddenly maven does not compile
C:\Users\nanjiang.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 Files\Java\jdk1.6.0_45\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
C:\Users\nanjiang.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中开发了几天,其他人的项目可以编译。
今天,我使用一台新的PC并像上面那样设置环境。
当我键入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:\idlecenter\idlecenter-client\target
[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仓库(例如“〜/ .m2 / repository / ...”),以查看父POM是否存在,并检查Maven是否下载了损坏的副本。 (该POM文件的外观与您在此页面上看到的相同吗?
如果它已损坏,则可以尝试删除“ ... / org.sonatype.oss / ...”子树,然后再次运行Maven。 如果仍然看到Maven故障,则可能需要检查如何配置上游存储库详细信息,等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.