Run an ant task in maven build phase before war is packaged?

前端 未结 2 1219
醉梦人生
醉梦人生 2020-12-16 19:11

When deploying a webapp I need to update some variables in UI resources, unzip some assets and concat some files, currently this is achieved via an ant task. I\'m trying to

2条回答
  •  佛祖请我去吃肉
    2020-12-16 19:55

    Since I did not get any answer on my comment I guess that you want to stay using maven-antrun-plugin.

    From what I've learned and experienced, if two plugins are to be executed on the same phase, then they will be executed in the order they are declared in pom.xml.

    For this to work you will have to add the maven-war-plugin in the list after the maven-antrun-plugin.

    
        org.apache.maven.plugins
        maven-antrun-plugin
        1.6
        
            
                deploy-ui
                package
                false
                
                    
                        
                        
                    
                
                
                    run
                
            
        
    
    
        org.apache.maven.plugins
        maven-war-plugin
        2.3
        
            
                
                default-war
                none
            
            
                
                war-exploded
                prepare-package
                
                    exploded
                
            
            
                
                custom-war
                package
                
                    war
                
            
        
    
    

    Added some more executions so that the default-war is first disabled, then the war is exploded and lastly the war is packaged.

提交回复
热议问题