0

I am trying to make a simply "mvn clean install" execution in a Maven project but it fails with this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war->plugin:2.2:war (default-war) on project xxxx: The specified web.xml file >'foo/target/classes/web.xml' does not exist ->

The configuration of the maven-war-plugin is:

 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>
 <configuration>
  <webResources>
    <resource>                       
         <directory>${basedir}/src/main/webapp</directory>
    <includes>                       
              <include>index.html</include>                      
              <include>build-info.html</include>                             
              <include>swagger-ui/index.html</include>
     </includes>                         
         <filtering>true</filtering>       
    </webResources>
  <finalName>xxxx</finalName>                
   <failOnMissingWebXml>false</failOnMissingWebXml>              
   <webXml>${project.build.outputDirectory}/web.xml</webXml>
<source>1.6</source>
<target>1.6</target>
</configuration>
 </plugin>

I don't know why it fails if is false. The web.xml file in the project is allocated in another folder, not in ${project.build.outputDirectory}/web.xml, but I can't modify the POM.xml because I only need to run the Maven install process.

Besides, in my POM configuration I don't have any phase detailed, so the problem I have is different than other post related. I am trying to set maven.war.webXml path but it doesn't make none for me.

Thanks in advance.

Idles28
  • 47
  • 2
  • 2
  • 12
  • Possible duplicate of [Why is maven-war-plugin failing for web.xml missing if I configured it not to fail on missing web.xml?](https://stackoverflow.com/questions/24291299/why-is-maven-war-plugin-failing-for-web-xml-missing-if-i-configured-it-not-to-fa) – Pino Mar 26 '19 at 14:04
  • Please use a more recent version of maven-war-plugin Please check here: https://maven.apache.org/plugins/ for the most recent ones ... – khmarbaise Mar 26 '19 at 19:54
  • how can I modify by command line the actual version from that plugin for the newest? I try with -Dartifact=org.apache.maven.plugins:maven-war-plugin:3.2.2 but Maven keeps working with 2.2 version and the error continues – Idles28 Mar 26 '19 at 21:57

0 Answers0