Multiple Dependency Scopes in POM

后端 未结 6 1774
离开以前
离开以前 2021-02-05 01:02

I have a dependency in my POM that needs to be set to \"provided\" so it is not included at compilation, but it can still be referenced within my project. I would like the same

6条回答
  •  太阳男子
    2021-02-05 01:44

    You could use a profile that either declares those dependencies as test or as provided - depending on what is more convenient for you:

    
        
            whatever
            
                
                    env
                    whatever 
                
            
            
                
                  yours
                  yours
                    provided
                
            
        
        
            test
            
                
                    env
                    test 
                
            
            
                
                  yours
                  yours
                    test
                
            
        
    
    

    Those profiles get activated by setting the property env but there are other ways, f.e. default activation - have a look here for that.

提交回复
热议问题