Maven更改了不同配置文件的插件顺序

 cathy李lee 发布于 2023-01-20 12:34

我有两个不同的pom.xml定义相同plugin(相同groupIdartifactId不同execution:-))的地方profiles.在executions以相同的定义phase,因此,为了通过从XML的顺序计算:



    4.0.0
    echo
    test
    echo-test
    1.0.0
    pom
    
        
            1st-profile
            
                true
            
            
                
                    
                        maven-antrun-plugin
                        
                            
                                1st-antrun-echo
                                test
                                
                                    run
                                
                                
                                    
                                        1st antrun plugin
                                    
                                
                            
                        
                    
                
            
        
        
            2nd-profile
            
                true
            
            
                
                    
                        com.soebes.maven.plugins
                        maven-echo-plugin
                        0.1
                        
                            
                                1st-soebes-echo
                                test
                                
                                    echo
                                
                                
                                    
                                        1st echo-plugin
                                    
                                
                            
                        
                    
                    
                        maven-antrun-plugin
                        
                            
                                2nd-antrun-echo
                                test
                                
                                    run
                                
                                
                                    
                                        2nd antrun plugin
                                    
                                
                            
                        
                    
                
            
        
    

所有插件执行都在test阶段中定义,因此我希望以下顺序:

1st antrun plugin
1st echo-plugin
2nd antrun plugin

但是,由于antrun-plugins合并,我得到这个输出:

1st echo-plugin    
1st antrun plugin    
2nd antrun plugin

此命令解释了为什么会发生这种情况: mvn help:effective-pom

除了引入新阶段之外,还有其他解决方案可以保留订单吗?我们的项目非常大,这是一个非常简单的例子.

为什么maven的限制是将插件合并为多个执行的插件?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有