apply plugin: 'groovy' apply plugin: 'maven' repositories { mavenCentral() } dependencies { compile gradleApi() compile localGroovy() compile 'org.ow2.asm:asm:5.2' compile 'com.android.tools.build:gradle:2.1.0' } group = "com.android.ares" version = '2.3.0' uploadArchives { /** * 请在根目录中添加local.properties文件,如果存在该文件,在该文件最后追加如下内容(包括用户名、密码、仓库地址) * userName=admin * password=***** * url=http://10.0.18.175/nexus/content/repositories/android/ */ def url = "https://nexus.uddream.cn/android" def userName = "admin" def password = "admin" File file = project.rootProject.file("local.properties") if (file.exists()) { Properties properties = new Properties() properties.load(file.newDataInputStream()) url = properties.getProperty("url") userName = properties.getProperty("userName") password = properties.getProperty("password") } repositories.mavenDeployer { repository(url: url) { authentication(userName: userName, password: password) pom.artifactId = "gradle-agent" } } }