Praneel Praneel - 1 year ago 109
Java Question

changing default structure in maven for war

My project folder structure is different from that of Maven. Can I still use Maven?

If yes ..
I want to use webContent folder instead of webapp .. how can i do that?

i already changed java folder to javaSource using .. can anyone help

Answer Source

You can have whatever structure you want and still use maven. Just define directory with your web resources.

<project>
...
<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>resource2</directory>
        </resource>
      </webResources>
    </configuration>
   </plugin>
  </plugins>
 </build>
 ...
</project>