From 2bdd4d5a32ba3a6b24984c8917b392688a1b01ce Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Tue, 28 Apr 2015 23:59:49 -0400 Subject: [PATCH] Maven: enable maven artifact publishing Currently to local repo only. --- common.gradle | 38 ++++++++++++++++++++++++++++++++++++++ gradle.properties | 11 +++++++++++ 2 files changed, 49 insertions(+) diff --git a/common.gradle b/common.gradle index 0852470e4..6af4c664f 100644 --- a/common.gradle +++ b/common.gradle @@ -4,6 +4,7 @@ apply plugin: 'java' apply plugin: 'maven' +apply plugin: 'maven-publish' group = 'com.jme3' version = jmeVersion + '-' + jmeVersionTag @@ -55,6 +56,43 @@ artifacts { } } +publishing { + publications { + maven(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + + pom.withXml { + asNode().children().last() + { + resolveStrategy = Closure.DELEGATE_FIRST + name POM_NAME + description POM_DESCRIPTION + url POM_URL + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEVELOPER_CONNECTION + } + licenses { + license { + name POM_LICENSE_NAME + url POM_LICENSE_URL + distribution POM_LICENSE_DISTRIBUTION + } + } + } + } + } + } + + repositories { + maven { + url "${rootProject.buildDir}/repo" // change to point to your repo, e.g. http://my.org/repo + } + } +} + task createFolders(description: 'Creates the source folders if they do not exist.') doLast { // sourceSets*.allSource*.srcDirs*.each { File srcDir -> // if (!srcDir.isDirectory()) { diff --git a/gradle.properties b/gradle.properties index 00429d65a..ccc3ed460 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,3 +23,14 @@ bulletZipFile = bullet.zip # Path for downloading NetBeans Base netbeansUrl = http://download.netbeans.org/netbeans/8.0.2/final/zip/netbeans-8.0.2-201411181905-javase.zip + +# POM settings +POM_NAME=jMonkeyEngine +POM_DESCRIPTION=jMonkeyEngine is a 3D game engine for adventurous Java developers +POM_URL=http://jmonkeyengine.org +POM_SCM_URL=https://github.com/jMonkeyEngine/jmonkeyengine +POM_SCM_CONNECTION=scm:git:git://github.com/jMonkeyEngine/jmonkeyengine.git +POM_SCM_DEVELOPER_CONNECTION=scm:git:git@github.com:jMonkeyEngine/jmonkeyengine.git +POM_LICENSE_NAME=New BSD (3-clause) License +POM_LICENSE_URL=http://opensource.org/licenses/BSD-3-Clause +POM_LICENSE_DISTRIBUTION=repo