0

我正在尝试安装一个 Maven 项目,我收到以下错误消息。

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

请帮我解决这个问题。

4

1 回答 1

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”参数明确指定其位置。

于 2013-05-20T07:58:45.670 回答