How to configure custom maven project structure

后端 未结 2 1557
礼貌的吻别
礼貌的吻别 2021-01-03 07:06

I know that typically maven structure is like this:

 pom.xml
 src
   - main
   - web
    - WEB-INF

However, I have a project which has the

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 07:39

    You can configure the maven-war-plugin to use another warSourceDirectory but as Jeff Storey explains in his answer it is really not recommended.

    This is how you would do it:

    
        ...
        
            
                
                    maven-war-plugin
                    2.3
                    
                        web
                    
                
            
        
        ...
    
    

    One of several problems is for example that the maven-jetty-plugin will not run out-of-the-box. It will by default look in src/main/webapp so that has to be configured.

    You might not use the maven-jetty-plugin but you get the idea.

提交回复
热议问题