2017-07-12 136 views
0

在非自動安裝的文件系統上,「mvn clean」工作(「mvn package」也是如此)。 ,就會向掛載文件系統,「MVN乾淨」的失敗,以下列方式:mvn在自動安裝的目錄上失敗

$ 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似乎無法在自動安裝的文件系統上工作。

+0

用戶可以創建目錄,文件,更改權限等。「mount」輸出顯示用戶具有「rw」權限:10.10.10.10:/ms/ms.share/services/ps/guest on/nethome/guest類型nfs(** rw **,relatime,vers = 3,rsize = 131072,wsize = 131072,namlen = 255,hard,proto = tcp,timeo = 600,retrans = 2,sec = sys,mountaddr = 10.20.30.70,mountvers = 3,mountport = 2049,mountproto = tcp,local_lock = none,addr = 10.20.30.70) – user2569618

+0

「用戶能夠創建目錄」 - 哪個用戶?你確定它是運行Maven作業的用戶嗎? –

+0

我相信如此。我可以登錄並執行mkdir〜/ .m2,但是當我刪除〜/ .m2並執行「mvn package」時,maven報告「無法在/ nethome/ /.m2/repository創建本地存儲庫」。我已經給安裝選項添加了「hard,nolock,noac」,但仍然沒有喜悅。 – user2569618

回答

0

這似乎是一個NFS問題。 JDK委託給本地函數調用Linux,並且底層的系統調用失敗。嘗試將Maven本地存儲庫目錄指向本地文件系統。具體而言,在文件apache-maven-${version}/conf/settings.xml,取消和更新行:

<localRepository>some_local_directory</localRepository> 
1

下似乎解決寫問題。

通過添加「硬,NOLOCK,NOAC」的自動安裝說明,用戶現在能夠運行「MVN」。不幸的是,在本地文件系統上建立1分鐘的時間在自動安裝的文件系統上大約需要15分鐘。但這是另一個問題/ stackoverflow的問題。