Skip to content

Commit 6ead852

Browse files
Merge pull request #127 from mailjet/4.4.0
4.4.0
2 parents 232c2c6 + dffc058 commit 6ead852

5 files changed

Lines changed: 80 additions & 65 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
target/*
2+
/.idea
23
/.classpath
34
/.project
45
/.settings/org.eclipse.core.resources.prefs
56
/.settings/org.eclipse.jdt.core.prefs
67
/.settings/org.eclipse.m2e.core.prefs
8+
mailjet-client.iml
9+
release.properties

pom.xml

Lines changed: 70 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--Schema definition-->
23
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
5+
<!--General configuration -->
46
<groupId>com.mailjet</groupId>
57
<artifactId>mailjet-client</artifactId>
6-
<version>4.2.1-SNAPSHOT</version>
8+
<version>4.4.0</version>
79
<packaging>jar</packaging>
810
<name>Mailjet Client</name>
911
<description>A Mailjet API Client</description>
1012
<url>https://github.com/mailjet/mailjet-apiv3-java/</url>
13+
<!--Distribution-->
1114
<distributionManagement>
1215
<snapshotRepository>
1316
<id>ossrh-snapshot</id>
@@ -18,18 +21,21 @@
1821
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
1922
</repository>
2023
</distributionManagement>
24+
<!--Source Control Management-->
2125
<scm>
2226
<connection>scm:git:https://github.com/mailjet/mailjet-apiv3-java.git</connection>
2327
<developerConnection>scm:git:https://github.com/mailjet/mailjet-apiv3-java.git</developerConnection>
2428
<url>git@github.com:mailjet/mailjet-apiv3-java.git</url>
25-
<tag>mailjet-client-4.2.1</tag>
29+
<tag>mailjet-client-4.4.0</tag>
2630
</scm>
31+
<!--License-->
2732
<licenses>
2833
<license>
2934
<name>MIT License</name>
3035
<url>http://www.opensource.org/licenses/mit-license.php</url>
3136
</license>
3237
</licenses>
38+
<!--Developer-->
3339
<developers>
3440
<developer>
3541
<name>Mailjet</name>
@@ -38,11 +44,13 @@
3844
<organizationUrl>http://www.mailjet.com</organizationUrl>
3945
</developer>
4046
</developers>
41-
<parent>
42-
<groupId>org.sonatype.oss</groupId>
43-
<artifactId>oss-parent</artifactId>
44-
<version>9</version>
45-
</parent>
47+
<!--Properties-->
48+
<properties>
49+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
50+
<maven.compiler.source>1.7</maven.compiler.source>
51+
<maven.compiler.target>1.7</maven.compiler.target>
52+
</properties>
53+
<!--Dependencies-->
4654
<dependencies>
4755
<dependency>
4856
<groupId>com.turbomanage.basic-http-client</groupId>
@@ -52,12 +60,12 @@
5260
<dependency>
5361
<groupId>org.json</groupId>
5462
<artifactId>json</artifactId>
55-
<version>20140107</version>
63+
<version>20190722</version>
5664
</dependency>
5765
<dependency>
5866
<groupId>junit</groupId>
5967
<artifactId>junit</artifactId>
60-
<version>4.11</version>
68+
<version>4.13</version>
6169
<type>jar</type>
6270
</dependency>
6371
<dependency>
@@ -67,87 +75,89 @@
6775
<scope>test</scope>
6876
</dependency>
6977
</dependencies>
70-
<properties>
71-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
72-
<maven.compiler.source>1.7</maven.compiler.source>
73-
<maven.compiler.target>1.7</maven.compiler.target>
74-
</properties>
78+
<!--Build Steps-->
7579
<build>
7680
<plugins>
77-
<plugin>
78-
<groupId>org.apache.maven.plugins</groupId>
79-
<artifactId>maven-release-plugin</artifactId>
80-
<version>2.5.3</version>
81-
<dependencies>
82-
<dependency>
83-
<groupId>org.apache.maven.plugins</groupId>
84-
<artifactId>maven-scm-plugin</artifactId>
85-
<version>1.8.1</version>
86-
</dependency>
87-
</dependencies>
88-
<configuration>
89-
<pushChanges>false</pushChanges>
90-
<checkModificationExcludes>
91-
<checkModificationExclude>pom.xml</checkModificationExclude>
92-
</checkModificationExcludes>
93-
<autoVersionSubmodules>true</autoVersionSubmodules>
94-
<goals>deploy</goals>
95-
<releaseProfiles>release</releaseProfiles>
96-
</configuration>
97-
</plugin>
81+
<!--Maven Release Plugin-->
9882
<plugin>
9983
<groupId>org.apache.maven.plugins</groupId>
100-
<artifactId>maven-source-plugin</artifactId>
101-
<executions>
102-
<execution>
103-
<id>attach-sources</id>
104-
<goals>
105-
<goal>jar</goal>
106-
</goals>
107-
</execution>
108-
</executions>
109-
</plugin>
110-
<plugin>
111-
<groupId>org.apache.maven.plugins</groupId>
112-
<artifactId>maven-javadoc-plugin</artifactId>
113-
<version>3.0.1</version>
84+
<artifactId>maven-release-plugin</artifactId>
85+
<version>2.5.3</version>
86+
<dependencies>
87+
<dependency>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-scm-plugin</artifactId>
90+
<version>1.8.1</version>
91+
</dependency>
92+
</dependencies>
11493
<configuration>
115-
<doclint>none</doclint>
94+
<pushChanges>false</pushChanges>
95+
<checkModificationExcludes>
96+
<checkModificationExclude>pom.xml</checkModificationExclude>
97+
</checkModificationExcludes>
98+
<autoVersionSubmodules>true</autoVersionSubmodules>
99+
<goals>deploy</goals>
100+
<releaseProfiles>release</releaseProfiles>
116101
</configuration>
117-
<executions>
118-
<execution>
119-
<id>attach-javadocs</id>
120-
<goals>
121-
<goal>jar</goal>
122-
</goals>
123-
</execution>
124-
</executions>
125102
</plugin>
103+
<!--Sona Type Plugin-->
126104
<plugin>
127105
<groupId>org.sonatype.plugins</groupId>
128106
<artifactId>nexus-staging-maven-plugin</artifactId>
129-
<version>1.6.7</version>
107+
<version>1.6.8</version>
130108
<extensions>true</extensions>
131109
<configuration>
132110
<serverId>ossrh</serverId>
133111
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
134112
<autoReleaseAfterClose>true</autoReleaseAfterClose>
135113
</configuration>
136114
</plugin>
115+
<!--GPG Plugin-->
137116
<plugin>
138117
<groupId>org.apache.maven.plugins</groupId>
139118
<artifactId>maven-gpg-plugin</artifactId>
140119
<version>1.6</version>
141120
<executions>
142121
<execution>
143122
<id>sign-artifacts</id>
144-
<phase>deploy</phase>
123+
<phase>verify</phase>
145124
<goals>
146125
<goal>sign</goal>
147126
</goals>
148127
</execution>
149128
</executions>
150129
</plugin>
130+
<!--Source Plugin-->
131+
<plugin>
132+
<groupId>org.apache.maven.plugins</groupId>
133+
<artifactId>maven-source-plugin</artifactId>
134+
<version>3.2.1</version>
135+
<executions>
136+
<execution>
137+
<id>attach-sources</id>
138+
<goals>
139+
<goal>jar</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
<!--JavaDoc Plugin-->
145+
<plugin>
146+
<groupId>org.apache.maven.plugins</groupId>
147+
<artifactId>maven-javadoc-plugin</artifactId>
148+
<version>3.2.0</version>
149+
<configuration>
150+
<doclint>none</doclint>
151+
</configuration>
152+
<executions>
153+
<execution>
154+
<id>attach-javadocs</id>
155+
<goals>
156+
<goal>jar</goal>
157+
</goals>
158+
</execution>
159+
</executions>
160+
</plugin>
151161
</plugins>
152162
</build>
153163
</project>

src/main/java/com/mailjet/client/MailjetClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ public class MailjetClient {
4444
public static final int NO_DEBUG = 0;
4545
public static final int VERBOSE_DEBUG = 1;
4646
public static final int NOCALL_DEBUG = 2;
47-
47+
4848
private ClientOptions _options;
4949
private BasicHttpClient _client;
5050
private BasicRequestHandler _handler;
5151

5252
private String _apiKey;
5353
private String _apiSecret;
5454
private String _token;
55+
private static final String userAgent = "mailjet-apiv3-java/v4.4.0";
5556
private int _debug = 0;
5657

5758
/**
@@ -154,7 +155,7 @@ private void initBasicAuth(String apiKey, String apiSecret) {
154155

155156
_client
156157
.addHeader("Accept", "application/json")
157-
.addHeader("user-agent", "mailjet-apiv3-java/v4.2.1")
158+
.addHeader("user-agent", this.userAgent)
158159
.addHeader("Authorization", "Basic " + authEncBytes);
159160

160161
}
@@ -164,7 +165,7 @@ private void initTokenAuth(String token) {
164165

165166
_client
166167
.addHeader("Accept", "application/json")
167-
.addHeader("user-agent", "mailjet-apiv3-java/v4.2.1")
168+
.addHeader("user-agent", this.userAgent)
168169
.addHeader("Authorization", "Bearer " + token);
169170

170171
}

src/main/java/com/mailjet/client/easy/MJEasySms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected MJEasySms(MJEasyClient client, MailjetRequest request) {
2222

2323
/**
2424
* Set the sender
25-
* @param sms sender name
25+
* @param number sender name
2626
* @return Current instance
2727
*/
2828
public MJEasySms from(String number) {

src/main/java/com/mailjet/client/errors/MailjetServerException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package com.mailjet.client.errors;
22

33
/**
4-
* MailjetServerException handles http status code >= 500 (Internal Server Error)
4+
* MailjetServerException handles http status code is greater than or equal to
5+
* 500 (Internal Server Error)
56
*
67
* @author y.vanov
78
*

0 commit comments

Comments
 (0)