改变maven中的默认结构以进行战争

Pra*_*ITI 0 java war maven

我的项目文件夹结构与Maven不同.我还可以使用Maven吗?

如果是..我想使用webContent文件夹而不是webapp ..我该怎么做?

我已经将java文件夹改为javaSource使用..任何人都可以提供帮助

Edu*_*ard 6

你可以拥有你想要的任何结构,但仍然使用maven.只需使用您的Web资源定义目录即可.

<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>
Run Code Online (Sandbox Code Playgroud)