123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- apply plugin: 'com.jfrog.artifactory'
- apply plugin: 'maven-publish'
- def ARTIFACT_ID = "ble-protocol"
- def packageName = "com.vivachek.ble"
- def libVersion = "0.0.1"
- task sourcesJar(type: Jar) {
- from sourceSets.main.java.srcDirs
- archiveClassifier = 'sources'
- }
- task javadocJar(type: Jar) {
- from javadoc
- archiveClassifier = 'javadoc'
- }
- publishing {
- publications {
- jar(MavenPublication) {
- groupId = packageName
- version = libVersion
- artifactId = ARTIFACT_ID
- from components.java
- // 生成源码包
- artifact sourcesJar
- // 生成javadoc包
- // artifact javadocJar
- }
- }
- }
- artifactory {
- contextUrl = artifactory_contextUrl
- publish {
- repository {
- repoKey = artifactory_repokey
- username = artifactory_username
- password = artifactory_password
- maven = true
- }
- defaults {
- // Tell the Artifactory Plugin which artifacts should be published to Artifactory.
- publications('jar')
- publishArtifacts = true
- // Properties to be attached to the published artifacts.
- properties = ['qa.level': 'basic', 'dev.team': 'core']
- // Publish generated POM files to Artifactory (true by default)
- publishPom = true
- }
- }
- }
|