2013-05-20 47 views
0

我想安装一个Maven项目,我收到以下错误消息。当Maven安装时,Maven会给出MojoExecutionException

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building mail maven webapp 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mail --- 
[debug] execute contextualize 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 5 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mail --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 13 source files to C:\Users\gk\workspace-juno\mail\target\classes 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mail 
[debug] execute contextualize 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mail --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 2 source files to C:\Users\gk\workspace-juno\mail\target\test-classes 
[INFO] 
[INFO] --- maven-surefire-plugin:2.13:test (default-test) @ mail --- 
    [INFO] Surefire report directory: C:\Users\gk\workspace-juno\mail\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running TestSuite 
Configuring TestNG with: TestNG652Configurator 
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.684 sec 

Results : 

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 

[INFO] 
[INFO] --- maven-war-plugin:2.3:war (default-war) @ mail --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [mail] in [C:\Users\gk\workspace-juno\mail\target\mail-1.0-SNAPSHOT] 
[INFO] Processing war project 
[INFO] Copying webapp resources [C:\Users\gk\workspace-juno\mail\src\main\webapp] 
[INFO] Webapp assembled in [895 msecs] 
[INFO] Building war: C:\Users\gk\workspace-juno\mail\target\mail.war 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 4.398s 
[INFO] Finished at: Mon May 20 12:28:45 IST 2013 
[INFO] Final Memory: 15M/35M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mail: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [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/MojoExecutionException 

请帮我解决这个问题。

+0

谢谢Zilvinas我会研究这个。 – Kris

回答

2

此错误是自我解释的:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mail: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] 

它说,你要么必须“WEB-INF”目录“的web.xml”文件中预先存在,或指定其位置明确使用在pom.xml或命令行中输入“webxml”参数。