Skip to content

Commit

Permalink
Merge pull request #4 from appoptics/fix/version
Browse files Browse the repository at this point in the history
Fix version in user-agent
  • Loading branch information
mheffner authored Oct 30, 2018
2 parents 9367720 + fb75308 commit a5e5273
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.idea
target
dependency-reduced-pom.xml
pom.xml.versionsBackup
22 changes: 15 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down Expand Up @@ -136,14 +147,11 @@
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* The main class that should be used to access the AppOptics API
*/
public class AppopticsClient {
private static final String LIB_VERSION = Versions.getVersion("META-INF/maven/com.appoptics.metrics/appoptics-java/pom.properties", AppopticsClient.class);
private static final String LIB_VERSION = Versions.getVersion("META-INF/maven/com.appoptics.metrics/appoptics-api-java/pom.properties", AppopticsClient.class);
private final URI uri;
private final int batchSize;
private final Duration connectTimeout;
Expand Down Expand Up @@ -42,7 +42,7 @@ public Thread newThread(Runnable r) {
this.executor = new ThreadPoolExecutor(0, attrs.maxInflightRequests, 10, TimeUnit.SECONDS, queue, threadFactory, new CallerRunsPolicy());
measurementPostHeaders.put("Content-Type", "application/json");
measurementPostHeaders.put("Authorization", Authorization.buildAuthHeader(attrs.token));
measurementPostHeaders.put("User-Agent", String.format("%s appoptics-java/%s", attrs.agentIdentifier, LIB_VERSION));
measurementPostHeaders.put("User-Agent", String.format("%s appoptics-api-java/%s", attrs.agentIdentifier, LIB_VERSION));
}

public PostMeasuresResult postMeasures(Measures measures) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AppopticsClientTest {
public void setUp() throws Exception {
headers.put("Content-Type", "application/json");
headers.put("Authorization", Authorization.buildAuthHeader(token));
headers.put("User-Agent", "test-lib appoptics-java/0.0.10");
headers.put("User-Agent", "test-lib appoptics-api-java/0.0.10");
}

@Test
Expand Down

0 comments on commit a5e5273

Please sign in to comment.