Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Stop relying on repackaged classes.
Browse files Browse the repository at this point in the history
Modify the way the artifact is pushed to Maven repository.
  • Loading branch information
ludoch committed Sep 15, 2017
1 parent d8f33c6 commit d59cd50
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 10 deletions.
73 changes: 69 additions & 4 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,32 @@
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<build>
<repositories>
<repository>
<id>sonatype-google-releases</id>
<name>Sonatype Google Releases</name>
<url>https://oss.sonatype.org/service/local/repositories/google-releases/content</url>
</repository>
<repository>
<id>gae-staging</id>
<url>https://oss.sonatype.org/content/repositories/comgoogleappengine-1394/</url>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
</snapshotRepository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -33,7 +58,19 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>-Psonatype-oss-release</arguments>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
Expand All @@ -58,7 +95,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0-rc1</version>
<version>19.0</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand All @@ -68,7 +105,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev68-1.21.0</version>
<version>v1-rev108-1.22.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -118,4 +155,32 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import com.google.appengine.api.urlfetch.HTTPResponse;
import com.google.appengine.api.utils.FutureWrapper;
import com.google.appengine.api.utils.SystemProperty;
import com.google.appengine.repackaged.com.google.common.escape.Escaper;
import com.google.appengine.repackaged.com.google.common.xml.XmlEscapers;
import com.google.appengine.tools.cloudstorage.BadRangeException;
import com.google.appengine.tools.cloudstorage.GcsFileMetadata;
import com.google.appengine.tools.cloudstorage.GcsFileOptions;
Expand All @@ -53,7 +51,9 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.escape.Escaper;
import com.google.common.io.BaseEncoding;
import com.google.common.xml.XmlEscapers;

import java.io.FileNotFoundException;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import java.util.NavigableMap;
import java.util.Random;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* End to end test to test the basics of the GcsService. This class uses the in-process
Expand Down Expand Up @@ -348,7 +350,7 @@ public void testBufferedReads() throws IOException {
}

@Test
public void testReadMetadata() throws IOException {
public void testReadMetadata() throws IOException, InterruptedException {
Date start = new Date(System.currentTimeMillis() - 1000);
int length = 1 * 1024 * 1024 + 1;
GcsFilename filename = new GcsFilename("testReadMetadataBucket", "testReadMetadataFile");
Expand All @@ -359,6 +361,7 @@ public void testReadMetadata() throws IOException {
assertEquals(content.length, metadata.getLength());
assertEquals(options, metadata.getOptions());
assertNotNull(metadata.getLastModified());
Thread.sleep(10); //10 millisecond at least, or Date comparison might break.
assertTrue(metadata.getLastModified().before(new Date()));
assertTrue(metadata.getLastModified().after(start));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void testDescribeRequestAndResponseForApiClient() throws Exception {
NetHttpTransport transport = new NetHttpTransport();
Storage storage = new Storage.Builder(transport, new JacksonFactory(), initializer)
.setApplicationName("bla").build();
HttpRequest request = storage.objects().delete("b", "o").buildHttpRequest();
HttpRequest request = storage.objects().delete("bucket", "object").buildHttpRequest();
request.getHeaders().clear();
request.getHeaders().put("k1", "v1");
request.getHeaders().put("k2", "v2");
Expand All @@ -75,8 +75,8 @@ public void testDescribeRequestAndResponseForApiClient() throws Exception {
} catch (HttpResponseException ex) {
exception = ex;
}
String expected = "Request: DELETE " + Storage.DEFAULT_BASE_URL + "b/b/o/o\n"
+ "k1: v1\nk2: v2\n\nno content\n\nResponse: 400 with 0 bytes of content\n";
String expected = "Request: DELETE " + Storage.DEFAULT_BASE_URL + "b/bucket/o/object\n"
+ "k1: v1\nk2: v2\n\nno content\n\nResponse: 40";
String result =
URLFetchUtils.describeRequestAndResponse(new HTTPRequestInfo(request), exception);
assertTrue(expected + "\nis not a prefix of:\n" + result, result.startsWith(expected));
Expand Down

0 comments on commit d59cd50

Please sign in to comment.