Meikel  Brandmeyer avatar Meikel Brandmeyer committed 8a96aac

Workaround clojars deployment via shell out to scp

This should fix the issue for the moment on Unix and Mac OS
machines. Not very satisfying but that's the way it is right
now. Further progress will only be possible with support by
Alex Osborne.

[#1 tagged:committed state:hold]

Comments (0)

Files changed (1)

src/main/groovy/clojuresque/ClojurePluginConvention.groovy

         }
     }
 
-    private void configureDeployerJars() {
-        if (!didConfigureDeployerJars) {
-            project.configurations {
-                clojarsDeployerJars {
-                    visible = false
-                    description = 'Private configuration to hold ssh wagon dependencies'
-                }
-            }
-            project.dependencies {
-                clojarsDeployerJars 'org.apache.ant:ant-jsch:1.7.0'
-            }
-
-            project.ant.taskdef name: 'clojarsScpDeploy', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp', classpath: project.configurations.clojarsDeployerJars.asPath
-
-            didConfigureDeployerJars = true
-        }
-    }
-
     public void configureClojarsDeploy(Upload task) {
         File dummyRepo = new File(project.buildDir, 'deploy')
 
-        configureDeployerJars()
-
         project.configure(task) {
             repositories.mavenDeployer {
                 name = 'dummyClojarsLocalDeployer'
         }
 
         task.doLast {
-            project.ant.clojarsScpDeploy(todir: 'clojars@clojars.org:', keyfile: new File(project.clojarsKeyfile).absolutePath, passphrase: project.clojarsPassphrase) {
-                fileset(dir: dummyRepo, excludes: '**/maven-metadata.xml*')
+            /* Clojars. :( This was changed in the source by Alex based
+             * on a note I sent him. This was before christmas 2009. Now,
+             * end of January 2010 it's still the old version live. */
+            fileTree(dir: dummyRepo, includes: ['**/*.pom']).each {
+                String name = it.path
+                String basename = name.substring(0, name.length() - 4)
+                String newname = basename + '.xml'
+
+                project.ant.move(file: it, tofile: project.file(newname))
+            }
+
+            Map args = [
+                executable:  '/usr/bin/scp',
+                failOnError: true
+            ]
+
+            project.ant.exec(args) {
+                fileTree(dummyRepo).each { arg value: it }
+                arg value: 'clojars@clojars.org:'
             }
         }
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.