java - Maven build excludes some .xml files from WEB-INF folder -


my web-inf folder contains 4 files , 1 directory:

drwxr-xr-x  238b aug 18 16:53 . drwxr-xr-x  136b aug 14 13:23 .. -rw-r--r--  302b aug 14 13:23 applicationcontext.xml -rw-r--r--  302b aug 14 13:23 dispatcher-servlet.xml -rw-r--r--  1.1k aug 18 16:53 spring-mvc-demo-servlet.xml drwxr-xr-x  102b aug 18 16:52 view -rw-r--r--  2.2k aug 18 16:53 web.xml 

maven configured build war package. here part of pom.xml:

    ...     <packaging>war</packaging>      ...     <build>         <plugins>             <plugin>                 <groupid>org.apache.maven.plugins</groupid>                 <artifactid>maven-war-plugin</artifactid>                 <configuration>                     <webxml>webapp\web-inf\web.xml</webxml>                 </configuration>             </plugin>         </plugins>     </build>     ... 

but when pack code uploading tomcat:

mvn clean compile war:exploded 

only web.xml file left in folder:

$ pwd spring-learning/target/1.0-snapshot/web-inf  $ ls -alh total 8 drwxr-xr-x 170b aug 18 17:08 . drwxr-xr-x 136b aug 18 17:08 .. drwxr-xr-x 170b aug 18 17:08 classes drwxr-xr-x 340b aug 18 17:08 lib -rw-r--r-- 2.2k aug 18 16:53 web.xml 

i took web.xml udemy course , contains references these additional .xml files, of course failed load on tomcat.

web.xml:

... <servlet>     <servlet-name>dispatcher</servlet-name>     <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class>     <init-param>         <param-name>contextconfiglocation</param-name>         <param-value>/web-inf/spring-mvc-demo-servlet.xml</param-value>     </init-param>     <load-on-startup>1</load-on-startup> </servlet> ... 

after 10+ hours of desperate googling noticed windows-type backslashes in pom.xml file. aware copying path strings internet!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -