Skip to content

Commit 9c26edc

Browse files
authored
Merge pull request #80 from microsoftgraph/dev
release 1.0.5
2 parents 0b78779 + 7fb1c41 commit 9c26edc

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ plugins {
1616
id 'com.jfrog.bintray' version '1.8.5'
1717
}
1818

19+
java {
20+
modularity.inferModulePath = true
21+
}
22+
1923
// In this section you declare where to find the dependencies of your project
2024
repositories {
2125
// Use jcenter for resolving your dependencies.
@@ -48,6 +52,12 @@ def pomConfig = {
4852
//Maven Central Release: publishMavenCentralReleasePublicationToMaven2Repository
4953
//Bintray Snapshot: publishSnapshotPublicationToMaven3Repository
5054

55+
tasks.jar {
56+
manifest {
57+
attributes('Automatic-Module-Name': project.property('mavenGroupId') + '.core')
58+
}
59+
}
60+
5161
task sourceJar(type: Jar) {
5262
from sourceSets.main.allJava
5363
archiveClassifier = 'sources'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph
2525
mavenArtifactId = microsoft-graph-core
2626
mavenMajorVersion = 1
2727
mavenMinorVersion = 0
28-
mavenPatchVersion = 4
28+
mavenPatchVersion = 5
2929
mavenArtifactSuffix =
3030
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3131

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020
2121
dependencies {
2222
// Include the sdk as a dependency
23-
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.4'
23+
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.5'
2424
}
2525
```
2626

@@ -32,7 +32,7 @@ Add the dependency in `dependencies` in pom.xml
3232
<dependency>
3333
<groupId>com.microsoft.graph</groupId>
3434
<artifactId>microsoft-graph-core</artifactId>
35-
<version>1.0.4</version>
35+
<version>1.0.5</version>
3636
</dependency>
3737
```
3838

src/main/java/com/microsoft/graph/httpcore/HttpClients.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.microsoft.graph.httpcore;
22

3+
import java.util.Arrays;
4+
35
import okhttp3.Interceptor;
46
import okhttp3.OkHttpClient;
7+
import okhttp3.Protocol;
58
import okhttp3.OkHttpClient.Builder;
69

710
public class HttpClients {
@@ -16,7 +19,10 @@ private HttpClients() {
1619
* @return OkHttpClient.Builder() custom builder for developer to add its own interceptors to it
1720
*/
1821
public static Builder custom() {
19-
return new OkHttpClient.Builder().addInterceptor(new TelemetryHandler());
22+
return new OkHttpClient.Builder()
23+
.addInterceptor(new TelemetryHandler())
24+
.followRedirects(false)
25+
.protocols(Arrays.asList(Protocol.HTTP_1_1)); //https://stackoverflow.com/questions/62031298/sockettimeout-on-java-11-but-not-on-java-8
2026
}
2127

2228
/**
@@ -27,11 +33,10 @@ public static Builder custom() {
2733
* @return OkHttpClient build with authentication provider given, default redirect and default retry handlers
2834
*/
2935
public static OkHttpClient createDefault(ICoreAuthenticationProvider auth) {
30-
return new OkHttpClient.Builder().addInterceptor(new AuthenticationHandler(auth))
31-
.followRedirects(false)
36+
return custom()
37+
.addInterceptor(new AuthenticationHandler(auth))
3238
.addInterceptor(new RetryHandler())
3339
.addInterceptor(new RedirectHandler())
34-
.addInterceptor(new TelemetryHandler())
3540
.build();
3641
}
3742

@@ -42,13 +47,12 @@ public static OkHttpClient createDefault(ICoreAuthenticationProvider auth) {
4247
* @return OkHttpClient build with interceptors provided
4348
*/
4449
public static OkHttpClient createFromInterceptors(Interceptor[] interceptors) {
45-
OkHttpClient.Builder builder = new OkHttpClient.Builder();
50+
OkHttpClient.Builder builder = custom();
4651
if(interceptors != null)
4752
for(Interceptor interceptor : interceptors) {
4853
if(interceptor != null)
4954
builder.addInterceptor(interceptor);
5055
}
51-
builder.addInterceptor(new TelemetryHandler());
5256
return builder.build();
5357
}
5458
}

src/main/java/com/microsoft/graph/httpcore/TelemetryHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class TelemetryHandler implements Interceptor{
1212

1313
public static final String SDK_VERSION = "SdkVersion";
14-
public static final String VERSION = "v1.0.4";
14+
public static final String VERSION = "v1.0.5";
1515
public static final String GRAPH_VERSION_PREFIX = "graph-java-core";
1616
public static final String JAVA_VERSION_PREFIX = "java";
1717
public static final String CLIENT_REQUEST_ID = "client-request-id";

0 commit comments

Comments
 (0)