How to properly specify jcenter repository in maven config?

后端 未结 3 1408
迷失自我
迷失自我 2021-02-13 01:44

In Gradle, I need simply add:

  repositories {  
   jcenter()  
  }

What is the simplest and proper way to do the same in maven pom.xml or wher

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-13 02:38

    You have to define settings.xml like the following. If you define it in ~/.m2/settings.xml it will be global to your maven. If you define it as a resource of your project you can bind it with the -s parameter:

    mvn -s settings.xml compile
    

    
    
        
        
            
                
                    
                        
                            false
                        
                        central
                        bintray
                        https://jcenter.bintray.com
                    
                
                
                    
                        
                            false
                        
                        central
                        bintray-plugins
                        https://jcenter.bintray.com
                    
                
                bintray
            
        
        
            bintray
        
    

提交回复
热议问题