Commits

Meikel Brandmeyer committed f59dca7

Deploy to clojars via http

  • Participants
  • Parent commits 3e0037e

Comments (0)

Files changed (1)

     group = 'clojuresque'
     version = '1.5.4-SNAPSHOT'
 
+    ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
+
     apply {
         plugin 'signing'
         plugin 'maven'
     }
+
+    repositories {
+        maven { url "http://127.0.0.1:8080/repository/internal" }
+        mavenCentral()
+    }
 }
 
 project(':clojuresque') {
         plugin 'java'
     }
 
-    repositories {
-        mavenCentral()
-    }
-
     dependencies {
         compile 'org.clojure:clojure:[1.2,1.5)'
     }
 }
 
 subprojects {
-    ext.pomFile = project.buildDir.path + "/" +
-            project.mavenPomDir.name + "/" +
-            project.name + "-" + project.version + ".xml"
+    configurations {
+        deployerJars
+    }
 
-    task writePom {
-        outputs.file project.pomFile
-    } << {
-        project.pom {
-            project {
-                licenses {
-                    license {
-                        name 'MIT License'
-                        url 'http://opensource.org/licenses/MIT'
-                        distribution 'repo'
+    dependencies {
+        deployerJars 'org.apache.maven.wagon:wagon-http-lightweight:2.2'
+    }
+
+    uploadArchives {
+        repositories {
+            mavenDeployer {
+                configuration = configurations.deployerJars
+                repository(url: "https://clojars.org/repo") {
+                    authentication(
+                        userName: project.properties["clojuresque.clojars.username"],
+                        password: project.properties["clojuresque.clojars.password"]
+                    )
+                }
+                pom.project {
+                    licenses {
+                        license {
+                            name 'MIT License'
+                            url 'http://opensource.org/licenses/MIT'
+                            distribution 'repo'
+                        }
+                    }
+                    description "A Clojure plugin for the Gradle build system"
+                    url "http://bitbucket.org/clojuresque/clojuresque"
+                    scm {
+                        connection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
+                        developerConnection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
+                        url 'hg@bitbucket.org:kotarak/clojuresque'
                     }
                 }
-                description "A Clojure plugin for the Gradle build system"
-                url "http://bitbucket.org/kotarak/clojuresque"
-                scm {
-                    connection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
-                    developerConnection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
-                    url 'hg@bitbucket.org:kotarak/clojuresque'
-                }
+                beforeDeployment { signing.signPom(it) }
             }
-        }.writeTo(project.pomFile)
-    }
-
-    artifacts {
-        writePom.outputs.files.each { archives it }
+        }
     }
 
     signing {
         sign configurations.archives
     }
-
-    signArchives {
-        dependsOn writePom
-    }
-
-    uploadArchives {
-        dependsOn project.writePom
-    } << {
-        project.exec {
-            commandLine(
-                '/usr/bin/scp',
-                project.pomFile,
-                project.pomFile + ".asc",
-                project.jar.archivePath.path,
-                project.jar.archivePath.path + ".asc",
-                'clojars@clojars.org:'
-            )
-        }
-    }
 }
 
 task wrapper(type: Wrapper) {