maven項目錯誤解決小結
注:整理錯誤,不喜歡為了一個小問題,占篇幅,是以請ctrl+f自己檢視,定位問題,願為解決.
注:網絡上的錯誤解決經驗,隻是作者在特定的條件下發生,或者适合你不适合你,請勿責怪,若無解決答案,請你請教他人或耐心解決,可以記錄之後分享,我們愛分享,一起開始吧!
問題1:
-dmaven.multimoduleprojectdirectory system propery is not set. check $m2_home environment variable and mvn script match.
解決1:
問題2:
java.lang.classnotfoundexception: org.springframework.web.util.introspectorcleanuplistener /org.springframework.web.context.contextloaderlistener
解決2:
問題3:
the import com.tsxs.common.tool.validatecodeimg cannot be resolved
解決3:
問題4:
caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'shirodbrealm' is defined
解決4:
問題5:
java project 轉換exchange maven project:
[error] plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: failure to find org.apache.maven.plugins:maven-jar-plugin:jar:2.4 in http://localhost:8081/nexus/content/groups/public was cached in the local repository,
resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [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] 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
解決5:
問題6:
九月 13, 2015 1:20:48 上午 org.apache.catalina.core.standardcontext listenerstart
嚴重: exception sending context initialized event to listener instance of class org.springframework.web.context.contextloaderlistener
org.springframework.beans.factory.beandefinitionstoreexception: ioexception parsing xml document from file
[d:\developer\softwares\servers\apache-tomcat-8.0.24\webapps\weloveshare\web-inf\classes\applicationcontext-mybatis.xml];
nested exception is com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: 3 位元組的 utf-8 序列的位元組 3 無效。
caused by: com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: 3 位元組的 utf-8 序列的位元組 3 無效。
error檔案
解決6:
問題7:
[error] failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4或failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.4..
解決7:
問題8:
[error] [help 1] http://cwiki.apache.org/confluence/display/maven/projectbuildingexception
[error] [help 2] http://cwiki.apache.org/confluence/display/maven/modelparseexception
解決8:
問題9:
maven中加入新的:dependency在install的時候,報錯nexus沒有相應的jar包
解決9:
問題10:
java project轉maven project因為出錯沒有maven dependencies路徑
解決10:
注:一般不用重新開機nexus伺服器,除非由于程序端口占用或者服務停止,或者伺服器關機或者當機,删除本地相對應的路徑檔案,clean install 則解決!
問題11:
設定pom.xml後,clean install編譯不報錯,就是不能加載maven dependencies和下載下傳jar包
解決11:
問題12:
如果pom.xml中<dependency>标簽報錯畫紅線并報紅叉,錯誤:missing artifact mycoding.kaka:kaka:jar:0.0.1
在markers中報錯:
description resource path location type
missing artifact mycoding.kaka:kaka:jar:0.0.1 pom.xml /zjavademo line 20 maven dependency problem
此問題解決,也适合第三方無依賴jar和本地擴充類加入maven統一管理
解決12:
1:如果為其他技術支援網站提供的的正确的依賴<dependency>,則删除本地maven的repositories下的相應位置jar的路徑和所有檔案,再clean install 則解決!
問題13:
description resource path location type
project configuration is not up-to-date with pom.xml. run maven->update project or use quick fix. webproject line 1 maven configuration problem
解決13:
問題14:
java compiler level does not match the version of the installed java project facet. webproject unknown faceted project problem (java version mismatch)
解決14:
問題15:
[error] d:\developerx\code\java\src\main\java\com\tsxs\module\utils\networkutil.java:[3,25] 錯誤: 程式包javax.servlet.http不存在
[error] d:\developerx\code\java\src\main\java\com\tsxs\module\utils\networkutil.java:[14,41] 錯誤: 找不到符号
解決15:
問題15擴充:頁面無controller處理跳轉也需要15解決!
<!-- 容器預設的defaultservlethandler處理 所有靜态内容與無requestmapping處理的url -->
<mvc:default-servlet-handler />
<!-- 定義無需controller的url<->view直接映射 -->
<mvc:view-controller path="/" view-name="redirect:/index.html" />
問題16:description resource path location type
one or more constraints have not been satisfied. webproject line 1 maven java ee configuration problem
提示16:檢視項目的jdk和compiler和eclipse工作空間workspace下項目下的個各個檔案中版本号
備注附件(解釋學習自網絡資料,非常感謝作者):
問題17:only whitespace content allowed before start tag and not \u0 (position: start_document se……
解決17:删除本地庫中所有檔案,重新clean install.