Skip to content

Instantly share code, notes, and snippets.

@zhengzhou
Created July 31, 2015 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhengzhou/fa9646470015da0f761d to your computer and use it in GitHub Desktop.
Save zhengzhou/fa9646470015da0f761d to your computer and use it in GitHub Desktop.
upload to maven
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