Created
August 26, 2015 11:32
-
-
Save damonliuchn/98d849073750f3656cf4 to your computer and use it in GitHub Desktop.
gradle publish to maven
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
sourceCompatibility = '1.7' | |
targetCompatibility = '1.7' | |
dependencies { | |
} | |
apply plugin: 'maven' | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
//repository(url: "file:///Users/liumeng/Documents/Backup/maven"){ | |
repository(url: "http://localhost:8081/nexus/content/repositories/snapshots") { | |
authentication(userName: "admin", password: "admin") | |
} | |
pom.version = "1.3" | |
pom.artifactId = "simple" | |
pom.groupId = "com.example" | |
} | |
} | |
} | |
task sourcesxxJar(type: Jar) { | |
classifier = 'sources' | |
from sourceSets.main.java.srcDirs | |
} | |
task javadocxxJar(type: Jar, dependsOn: javadoc) { | |
classifier = 'javadoc' | |
from sourceSets.main.java.srcDirs | |
} | |
artifacts { | |
archives sourcesxxJar | |
archives javadocxxJar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment