Add the maven-publish plugin to the build
plugins {
id 'java'
+ id 'maven-publish'
id 'idea'
id 'eclipse'
id 'net.ltgt.apt-idea' version '0.15'
@@ -79,3 +80,40 @@ task execute(type:JavaExec) {
systemProperties = System.properties
}
+publishing {
+ /*
+ repositories {
+ maven {
+ url "url here"
+ credentials {
+ username 'username'
+ password 'password'
+ }
+ name "repo name"
+ }
+ }
+ */
+ publications {
+ mavenJava(MavenPublication) {
+ from components.java
+ artifact sourceJar
+ artifact packageJavadoc
+ }
+ }
+}
+
+javadoc {
+ source = sourceSets.main.allJava
+ classpath = configurations.compileClasspath
+}
+
+task packageJavadoc(type: Jar) {
+ from javadoc
+ classifier = 'javadoc'
+}
+
+task sourceJar(type: Jar) {
+ classifier = 'sources'
+ from sourceSets.main.allJava
+}
+
