123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- task sourcesJar(type: Jar) {
- baseName "${baseName}"
- classifier 'sources'
- from sourceSets.main.allSource
- }
- artifacts {
- archives sourcesJar
- }
- apply plugin: 'distribution'
- distributions {
- main {
- baseName = archivesBaseName
- contents {
- from { libsDir }
- }
- }
- docs {
- baseName = "$archivesBaseName-docs"
- contents {
- from(libsDir) {
- include sourcesJar.archiveName
- }
- }
- }
- }
- ext {
- artifactoryBaseUrl = 'http://113.105.74.141:8081/artifactory'
- artifactorySnapshotRepoUrl = "$artifactoryBaseUrl/libs-snapshot-local"
- artifactoryReleaseRepoUrl = "$artifactoryBaseUrl/libs-release-local"
- }
- apply plugin: 'maven-publish'
- publishing {
- publications {
- plugin(MavenPublication) {
- from components.java
- artifactId "${artifactId}"
- pom.withXml {
- def root = asNode()
- root.appendNode('name', "${baseName}")
- root.appendNode('description', '商城轮播服务')
- root.appendNode('inceptionYear', '2017')
- def developer = root.appendNode('developers').appendNode('developer')
- developer.appendNode('id', 'yangck')
- developer.appendNode('name', '杨朝坤')
- developer.appendNode('email', 'yangck@usoftchina.com')
- }
- artifact sourcesJar
- }
- }
- repositories {
- maven {
- name 'myLocal'
- url "file://$projectDir/repo"
- }
- maven {
- name 'remoteArtifactory'
- url project.version.endsWith('-SNAPSHOT') ? artifactorySnapshotRepoUrl : artifactoryReleaseRepoUrl
- credentials {
- username = 'yingp'
- password = '111111'
- }
- }
- }
- }
|