2015-07-03 32 views

回答

0

你可以做到這一點,例如通過以下方式:

apply plugin: 'java' 
apply plugin: Lol 

dependencies { 
    compile 'com.google.guava:guava:18.0' 
} 

task cl(type: Copy) { 
    from configurations.compile 
    into 'libs' 
} 

class Lol implements Plugin<Project> { 
    void apply(Project p) { 
     def repositoriesConf = { 
      mavenCentral() 
      jcenter() 
     } 
     p.repositories(repositoriesConf) 
    } 
} 

實現此任務的方法有很多種。請注意這個事實,也將需要java插件,也許你需要實現的插件應該也應用java插件。

+0

@ChristianGoetze,我的答案是否解決了這個問題?如果是,請接受它。 – Opal

相關問題