-
Notifications
You must be signed in to change notification settings - Fork 0
/
mavenPrivate.gradle
37 lines (36 loc) · 1.29 KB
/
mavenPrivate.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**②.发布到私有服务器maven仓库*/
apply plugin: 'maven'
/*task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}*/
//打包java文档的 task
/*task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}*/
//打包main目录下文件的 task
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
//配置需要上传到maven仓库的文件
artifacts {
archives androidSourcesJar
// archives androidJavadocsJar
}
//上传到Maven仓库的task
uploadArchives {
repositories {
mavenDeployer {
//指定maven仓库url
repository(url: "http://localhost:8081/nexus/content/repositories/releases/") {
//nexus登录默认用户名和密码
authentication(userName: "admin", password: "admin123")
}
pom.groupId = "com.openxu.viewlib"// 唯一标识(通常为模块包名,也可以任意)
pom.artifactId = "OXViewLib" // 项目名称(通常为类库模块名称,也可以任意)
pom.version = "1.0.0" // 版本号
}
}
}