基于Maven管理的web项目结构:

对于Maven管理的项目制定虚拟目录

target目录是用来存放项目打包之后生成的文件的目录,此目录中的文件必须调用mvn clean package后才能生成,

如果把虚拟目录设置在此目录中,则每次修改项目后都需要调用mvn,很不方便

正确方法:

  1.设置虚拟目录为:src/main/webapp

  2.在pom.xml中更改maven打包的目录位置

<!-- 更改maven默认的打包目录 -->
            <plugin>
               <artifactId>maven-war-plugin</artifactId>
               <configuration>
                   <webappDirectory>${basedir}/src/main/webapp</webappDirectory>
                   <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
               </configuration>
           </plugin>   

 

 

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-07-12
  • 2021-12-04
  • 2021-05-08
  • 2021-07-23
  • 2021-07-18
  • 2021-12-15
猜你喜欢
  • 2022-01-14
  • 2021-08-23
  • 2021-12-05
  • 2022-12-23
  • 2021-08-01
  • 2021-10-04
  • 2021-11-28
相关资源
相似解决方案