Error generating jar project

0

I wanted to generate a JAR from the project I did on maven (simple). But it generates this error. Why did you generate this error?

[INFO] --- maven-war-plugin:2.2:war (default-war) @ teste-MODEL ---
[INFO] Packaging webapp
[INFO] Assembling webapp [teste-MODEL] in [C:\Users\ooo\Documents\workspace-ggts-3.6.4.RELEASE\teste-   MODEL\target\teste-MODEL-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\ooo\Documents\workspace-ggts-  3.6.4.RELEASE\teste-MODEL\src\main\webapp]
[INFO] Webapp assembled in [50 msecs]
[INFO] Building war: C:\Users\ooo\Documents\workspace-ggts-3.6.4.RELEASE\teste-MODEL\target\teste-MODEL-0.0.1-SNAPSHOT.war

[INFO] BUILD FAILURE

[INFO] Total time: 3.480 s
[INFO] Finished at: 2016-02-10T01:06:15-03:00
[INFO] Final Memory: 8M/21M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project teste-MODEL: 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
    
asked by anonymous 10.02.2016 / 05:04

1 answer

0

If your application does not use web.xml for some reason (servlet 3.0 for example), you can ignore the validation of that file.

Add the code below in the plugins section of your pom.xml

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
    <failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

Retired from this stackoverflow link

    
15.08.2018 / 14:39