0

I am trying to build a war file but some files are left out, paticularlly files inside the same directory as src.

The Project structure is: MyProject src project web-servlet.xml

When I generate the war file and extract it, it gives me a project folder with everything from src, but it doesn't give me the web-servlet.xml file.

<groupId>com.project</groupId>
<artifactId>project</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Project</name>


<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.2.2</version>
    <configuration>
      <webappDirectory>/project</webappDirectory>
    </configuration>
  </plugin>

I would expect it to bundle in the web-servlet.xml but it is not. Is there a way I can force maven to do this?

Ericode
  • 136
  • 3
  • 15

1 Answers1

0

I recomend you use the standard directory structure as is laid out in the maven war plugin documentation http://maven.apache.org/components/plugins/maven-war-plugin/usage.html

In which case your web.xml should be under src/main/webapp/WEB-INF

Deadron
  • 5,135
  • 1
  • 16
  • 27