gpt4 book ai didi

java - mvn 在自动挂载目录上失败

转载 作者:行者123 更新时间:2023-12-02 02:43:21 25 4
gpt4 key购买 nike

在非自动挂载的文件系统上,“mvn clean”可以工作(“mvn package”也可以)。在自动挂载的文件系统上,“mvn clean”会以下列方式失败:

 $ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building glutmax-sentiment-analysis 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to read tracking file /nethome/guest/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom.lastUpdated
java.io.IOException: Input/output error
at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:90)
[...]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to write tracking file /nethome/guest/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom.lastUpdated
java.io.IOException: Input/output error
at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:90)
[...]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:13 min
[INFO] Finished at: 2017-07-12T11:34:55-07:00
[INFO] Final Memory: 23M/1445M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Input/output error -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException


$ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T12:39:06-07:00)
Maven home: /usr/local/maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/local/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-514.el7.x86_64", arch: "amd64", family: "unix"

显然,我缺少某种配置信息,但搜索我找到的答案是我需要删除 ~/.m2/*、chmod 777 ~/.m2,并确保我的 JAVA_HOME 是正确的。这些建议都不起作用。我错过了什么?

有趣的是,Gradle 似乎也不适用于自动挂载的文件系统。

最佳答案

这似乎是 NFS 问题。 JDK 委托(delegate)给 Linux 的 native 函数调用,并且底层系统调用失败。尝试将 Maven 本地存储库目录指向本地文件系统。具体来说,在文件 apache-maven-${version}/conf/settings.xml 中,取消注释并更新行:

<localRepository>some_local_directory</localRepository>

关于java - mvn 在自动挂载目录上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45065516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com