Created
July 31, 2015 07:05
-
-
Save zhengzhou/fa9646470015da0f761d to your computer and use it in GitHub Desktop.
upload to maven
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext { | |
buildToolsVersion = '22.0.1' | |
supportVersion = '22.2.1' | |
userName = 'xuzhengzhou' | |
password = '123' | |
} | |
buildscript{ | |
repositories{ | |
jcenter() | |
maven { url 'http://192.168.1.200:8081/nexus/content/groups/public/' } | |
} | |
dependencies{ | |
classpath 'com.android.tools.build:gradle:1.2.3' | |
} | |
} | |
allprojects { | |
repositories{ | |
jcenter() | |
maven { url 'http://192.168.1.200:8081/nexus/content/groups/public/' } | |
} | |
} | |
apply plugin: 'maven' | |
def pomDefine = {Closure configureClosure -> | |
configureClosure() | |
} | |
//上传任务 | |
uploadArchives { | |
repositories.mavenDeployer { | |
name = 'xinyi maven' | |
//release版本 | |
repository(url: "http://192.168.1.200:8081/nexus/content/repositories/releases/") { | |
authentication(userName: rootProject.ext.userName, password: rootProject.ext.password) | |
} | |
//snapshot版本 | |
snapshotRepository(url: "http://192.168.1.200:8081/nexus/content/repositories/snapshots/") { | |
authentication(userName: rootProject.ext.userName, password: rootProject.ext.password) | |
} | |
pomDefine { | |
} | |
pom.version = "1.0.0-SNAPSHOT" //版本号 | |
pom.artifactId = "general" //项目名称 | |
pom.groupId = "com.mgyun.general" //所属组, 一般公司通用的使用com.mgyun.{$项目名}, 桌面的使用com.mgyun.launcher8 | |
pom.name = "base" | |
pom.packaging = 'aar' | |
} | |
} | |
//打包源码. | |
task sourcesJar(type: Jar) { | |
from android.sourceSets.main.java.srcDirs | |
classifier = 'sources' | |
} | |
artifacts { | |
archives sourcesJar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment