Exclude dependency in a profile

后端 未结 6 1984
别那么骄傲
别那么骄傲 2021-02-06 23:49

I have a maven module which has some dependencies. In a certain profile, I want to exclude some of those dependencies (to be exact, all dependencies with a certain group id). Th

6条回答
  •  Happy的楠姐
    2021-02-07 00:45

    One way that occurs to me is to have the dependencies in a separate pom. You can then add an section via the profile.

    
        
            my.company.dependencies
            my-dependencies
            1.0.0-SNAPSHOT
            pom
        
    
    
    
        
            false
            
                exclude-deps
            
        
    
        
            
                my.company.dependencies
                my-dependencies
                1.0.0-SNAPSHOT
                pom
                
                    
                        my.company
                        bad-dep-1
                    
                    
                        my.company
                        bad-dep-2
                    
                
           
    
    
    

提交回复
热议问题