Permalink
Browse files

Merge pull request #15 from rgladwell/put-support

Support for wagon:upload goal
  • Loading branch information...
khuxtable committed Sep 17, 2011
2 parents e4dfb3a + ba05716 commit 93366498a168785c11a2a062f8b2c64dc1fe2694
Showing with 38 additions and 3 deletions.
  1. +31 −0 pom.xml
  2. +7 −3 src/main/java/org/kathrynhuxtable/maven/wagon/gitsite/GitSiteWagon.java
View
31 pom.xml
@@ -69,6 +69,37 @@
<artifactId>plexus-maven-plugin</artifactId>
<version>1.3.8</version>
</plugin>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.codehaus.plexus
+ </groupId>
+ <artifactId>
+ plexus-maven-plugin
+ </artifactId>
+ <versionRange>
+ [1.3.8,)
+ </versionRange>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -529,7 +529,7 @@ public void connect(Repository repository, AuthenticationInfo authenticationInfo
* @see org.apache.maven.wagon.Wagon#put(java.io.File, java.lang.String)
*/
public void put(File source, String destination) throws TransferFailedException {
- throw new TransferFailedException("Not currently supported: put");
+ putResource(source, destination);
}
/**
@@ -541,7 +541,11 @@ public void putDirectory(File sourceDirectory, String destinationDirectory) thro
throw new IllegalArgumentException("Source is not a directory: " + sourceDirectory);
}
- Resource target = new Resource(destinationDirectory);
+ putResource(sourceDirectory, destinationDirectory);
+ }
+
+ private void putResource(File sourceDirectory, String destinationDirectory) throws TransferFailedException {
+ Resource target = new Resource(destinationDirectory);
firePutInitiated(target, sourceDirectory);
@@ -601,7 +605,7 @@ public void putDirectory(File sourceDirectory, String destinationDirectory) thro
}
firePutCompleted(target, sourceDirectory);
- }
+ }
/**
* Check that the ScmResult was a successful operation

0 comments on commit 9336649

Please sign in to comment.