Skip to content

Instantly share code, notes, and snippets.

@bladeFury
Last active August 29, 2015 14:10
Show Gist options
  • Save bladeFury/988e80cd4e23a2707454 to your computer and use it in GitHub Desktop.
Save bladeFury/988e80cd4e23a2707454 to your computer and use it in GitHub Desktop.
maven push gradle file
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'maven'
def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}
def getReleaseRepositoryUrl() {
return "http://115.29.39.214:8081/nexus/content/repositories/releases"
}
def getSnapshotRepositoryUrl() {
return "http://115.29.39.214:8081/nexus/content/repositories/snapshots"
}
def getRepositoryUsername() {
return producerName;
}
def getRepositoryPassword() {
return producerPass;
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = "com.wukongtv.lib"
pom.artifactId = libName
pom.version = versionName
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
// pom.project {
// name POM_NAME
// packaging POM_PACKAGING
// description POM_DESCRIPTION
// url POM_URL
// }
}
}
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archives androidSourcesJar
//archives androidJavadocsJar
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment