bug 404332: Configures deployment to BuildEclipseOrg and CentralSonatype
diff --git a/build.gradle b/build.gradle
index 45537e5..9c97d71 100644
--- a/build.gradle
+++ b/build.gradle
@@ -29,7 +29,7 @@
         if(buildQualifier) { 
             version = version + '.' + buildQualifier
         } else {
-            version = version + '.' + timestamp
+            version = version + '.D-' + timestamp
         }
     } else {
         version = version + '.SNAPSHOT'
@@ -238,12 +238,16 @@
     }
 }
 
-configure(javaProjects) {
+configure(javaProjects + project(':org.eclipse.virgo.bundlor.gradle')) {
     apply plugin: 'maven-publish'
 
     publishing {
         publications {
-        	all {
+        	bundlor(MavenPublication) {
+        	    from components.java
+                artifact sourcesJar
+                artifact javadocJar
+                groupId 'org.eclipse.virgo.bundlor'
         		pom.withXml {
                     asNode().with {
                         appendNode('description', 'Bundlor is a tool that automates the detection of dependencies and the creation of OSGi manifest directives for JARs after their creation. Bundlor takes as input a JAR and a template consisting of a superset of the standard OSGi manifest headers.')
@@ -272,13 +276,23 @@
                     }
                 }
         	}
-            maven(MavenPublication) {
-                from components.java
-                artifact sourcesJar
-                artifact javadocJar
-                groupId 'org.eclipse.virgo.bundlor'
-            }
         }
+        repositories {
+            maven {
+                name = "BuildEclipseOrg"
+                url "/opt/public/rt/virgo/gradle/bundles"
+            }
+            if(System.properties['ci.build'] == 'true') {
+                maven {
+                    name = "CentralSonatype"
+                    credentials {
+                        username ossrhUsername
+                        password ossrhPassword
+                    }
+                    url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
+                }
+            }
+        }        
     }
 }
 
diff --git a/org.eclipse.virgo.bundlor.gradle/build.gradle b/org.eclipse.virgo.bundlor.gradle/build.gradle
index da1590f..25cdaa0 100644
--- a/org.eclipse.virgo.bundlor.gradle/build.gradle
+++ b/org.eclipse.virgo.bundlor.gradle/build.gradle
@@ -4,7 +4,6 @@
 	id 'groovy'
 	id 'eclipse'
 	id 'java-gradle-plugin'
-	id 'maven-publish'
 	id 'jacoco'
 }
 
@@ -27,6 +26,20 @@
 	from "$rootDir/build-bundlor/resources/about"
 }
 
+task sourcesJar(type: Jar, dependsOn: classes) {
+	description 'Assembles a jar archive containing the sources.'
+	group = 'build'
+    classifier = 'sources'
+	from sourceSets.main.allSource
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    description 'Assembles a jar archive containing the javadocs.'
+	group = 'build'
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
 repositories {
 	mavenCentral()
 }
@@ -48,14 +61,3 @@
 	}
 }
 
-publishing {
-	repositories {
-		mavenLocal()
-	}
-	publications {
-		maven(MavenPublication) {
-			from components.java
-			groupId 'org.eclipse.virgo.bundlor'
-		}
-	}
-}