Skip to content

Commit

Permalink
#41 cmpChecksum doesn't work when using Amazon S3
Browse files Browse the repository at this point in the history
  • Loading branch information
chonton committed Jul 1, 2023
1 parent e13f2ff commit 22e033a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ In the following table `p:` indicates the default constituent properties are pre
<plugin>
<groupId>org.honton.chas</groupId>
<artifactId>exists-maven-plugin</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.honton.chas</groupId>
<artifactId>exists-maven-plugin</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
<packaging>maven-plugin</packaging>

<name>Artifact Exists Maven Plugin</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>

<plugin.version>0.10.0</plugin.version>
<plugin.version>0.11.0</plugin.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/honton/chas/exists/RemoteExistsMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,19 @@ private String getRemoteFile(String path) throws Exception {
}
}

private static String stripTrailingSlash(String path) {
int lastIdx = path.length() - 1;
return path.charAt(lastIdx) == '/' ? path.substring(0, lastIdx) : path;
}

private class WagonHelper implements AutoCloseable {

private final Wagon wagon;

WagonHelper(String uri) throws Exception {
String id = isSnapshot() ? snapshotServerId : serverId;
wagon = connectWagon(id == null ? "" : id, uri);
// https://github.com/chonton/exists-maven-plugin/issues/41
wagon = connectWagon(id == null ? "" : id, stripTrailingSlash(uri));
}

Wagon connectWagon(String serverId, String url) throws Exception {
Expand Down

0 comments on commit 22e033a

Please sign in to comment.