Skip to content

Commit 67038e1

Browse files
authored
Merge pull request #1 from square/ssung/setup_travis
Setup Travis
2 parents 7909e58 + 5ac76b0 commit 67038e1

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: java
2+
jdk:
3+
- openjdk8
4+
script:
5+
- mvn test -B
6+
before_install:
7+
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
8+
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
9+
env:
10+
global:
11+
- secure: W8iAxgQPbEd1Kc8QBYAW9b5pRtlr759VRrO4qxHKfjH9knqnRfsOgoyv72BhGWOQ2YNYik6m/vF81tRwhLusQ1H2pNNKKLknmv74eGGJnylFQrmS46IYvUx8UmWqv+Tt9Q36JnfA3/p+uZcLqaTHry72F1D3tdmYSjlwdUGCpLCTpg/ATIj+kPzUWNoP5dUw4ccQ+1Uu2cBwsSF8Mqs1Yd5UmLSyNwD/zYPwO2c3d9PFn4c+hTTojJFa74a7U+G/qmbPlgtSal/95LY7Qdx2ABNvAXd9nCcf89I7vyUt9vjNW5fUKLgGfxcKOufkfuvxNh4FBrhR2gqgY6aNs6EgcyZEyZMH+ZLoO2UpTlJdDDHkJiDdRytDgY9OqT07KS8ftsVAQt5Fa0xXBIS5YXqroZgEC1m2LzpcoODN976KCC0VgfGSN1dj3Y0Xg+022Gm+1pEU3krBGRR4VGKPLj/mB6mIAQcKuVJdhNis5NSqWRDHJsYW+MO+Z0SiwPUsshrDA9QrLwbWhfgkBny0FgqroohrmhkOPmCrKzHONoAF5nJXQEFofkvPgigPLdztFaB7riaxt7zOCMoa6OeSBLZY7QvTgRu6rPPHKsjE5Ctnxl7UBZ7q5wFfBvwCAaHJON6w1CSNxWztgKC2FplyIEwevR4U8li9daFDgI0n+zYizs0=
12+
- secure: q5regKtflZbKY4fCq02v5hANqBmFSpyyjVsTRFSZ4WEigvZ007rCzBAI8XzN2Y7lZsGsGhkoWDWHbzonCpeUOWRiTHMYUivdeQkVNFGnP6BewpnAFT5QuNXxKM6on7T7iXTwqBSVrA2fwvKYa7Sf3jc9JyEptut7/cdwd5r+b/dqtN/NhjKKqWcsq/BTgyZ/7E7+Y3w42nGm+h96rvkLtHgFkYM5o2YBZzjn7BycVimE7MBLFLhNtABt9WtnVih0MBbZKPu5Yw7f/8Exs54IOL0Hke/T1S+Fuc2vnRVS7Az6VxDgdA1Y+q/gmiUoODXBcQddwOrlh71rSg346a0e8PbBA/BOtS2/sltAYA/weeqszhDGFAueKtWtRWv+zTCK9jWbP8Wpjs11cUPjyauifyntcYSm/uQSxno4WEk7bxo1FM8zRPlhqKVN5st5SI8SSuBGLzz+LsyRbgm9cwCtZempz07INKyGDmkYtRVR/wnv1Zv4pNkvm21y/jY8QkONFv1lfdlJhdjNlKuvapT4SAH8CbvdMpiDUg+zHDsbAxWtN+YFfQlINd74OOhoaT0UFP3PtMMer7/ashbLTLJ3aYHcmmoNxwUdp11cltZ5xlS65ZWbspJphghD00OatQT05dTF614eX5OWN9qyqa5Ft7fpXufU6X0sjszNpBTU2Ws=
13+
after_success:
14+
- "./maven/deploy.sh"

maven/deploy.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
3+
mvn clean deploy --settings maven/settings.xml -DskipTests=true -B -U -Prelease
4+
fi

maven/settings.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0" xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0
2+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
3+
<servers>
4+
<server>
5+
<!-- Maven Central Deployment -->
6+
<id>ossrh</id>
7+
<username>${env.SONATYPE_USERNAME}</username>
8+
<password>${env.SONATYPE_PASSWORD}</password>
9+
</server>
10+
</servers>
11+
12+
<profiles>
13+
<profile>
14+
<id>ossrh</id>
15+
<activation>
16+
<activeByDefault>true</activeByDefault>
17+
</activation>
18+
<properties>
19+
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
20+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
21+
</properties>
22+
</profile>
23+
</profiles>
24+
</settings>

pom.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,38 @@
99
<name>square</name>
1010
<url>https://github.com/square/square-java-sdk/</url>
1111
<description>Java client library for the Square API</description>
12+
<scm>
13+
<connection>scm:git:https://github.com/square/square-java-sdk.git</connection>
14+
<developerConnection>scm:git:[email protected]:square/square-java-sdk.git</developerConnection>
15+
<url>https://github.com/square/square-java-sdk/</url>
16+
</scm>
17+
<licenses>
18+
<license>
19+
<name>Apache 2.0</name>
20+
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
21+
<distribution>repo</distribution>
22+
</license>
23+
</licenses>
24+
25+
<developers>
26+
<developer>
27+
<name>Square Inc.</name>
28+
<email>[email protected]</email>
29+
<organization>Square Inc. Developers</organization>
30+
<organizationUrl>https://squareup.com/developers</organizationUrl>
31+
</developer>
32+
</developers>
33+
34+
<distributionManagement>
35+
<snapshotRepository>
36+
<id>ossrh</id>
37+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
38+
</snapshotRepository>
39+
<repository>
40+
<id>ossrh</id>
41+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
42+
</repository>
43+
</distributionManagement>
1244

1345
<build>
1446
<pluginManagement>
@@ -81,6 +113,76 @@
81113
<maven.compiler.target>1.8</maven.compiler.target>
82114
</properties>
83115

116+
<profiles>
117+
<profile>
118+
<id>release</id>
119+
<activation>
120+
<property>
121+
<name>release</name>
122+
</property>
123+
</activation>
124+
<build>
125+
<plugins>
126+
<!-- To release to Maven central -->
127+
<plugin>
128+
<groupId>org.sonatype.plugins</groupId>
129+
<artifactId>nexus-staging-maven-plugin</artifactId>
130+
<version>1.6.8</version>
131+
<extensions>true</extensions>
132+
<configuration>
133+
<serverId>ossrh</serverId>
134+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
135+
<autoreleaseafterclose>true</autoreleaseafterclose>
136+
</configuration>
137+
</plugin>
138+
<!-- To generate javadoc -->
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-source-plugin</artifactId>
142+
<version>3.0.1</version>
143+
<executions>
144+
<execution>
145+
<id>attach-sources</id>
146+
<goals>
147+
<goal>jar-no-fork</goal>
148+
</goals>
149+
</execution>
150+
</executions>
151+
</plugin>
152+
<plugin>
153+
<groupId>org.apache.maven.plugins</groupId>
154+
<artifactId>maven-javadoc-plugin</artifactId>
155+
<version>2.10.4</version>
156+
<executions>
157+
<execution>
158+
<id>attach-javadocs</id>
159+
<goals>
160+
<goal>jar</goal>
161+
</goals>
162+
</execution>
163+
</executions>
164+
</plugin>
165+
166+
<!-- To sign the artifacts -->
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-gpg-plugin</artifactId>
170+
<version>1.6</version>
171+
<executions>
172+
<execution>
173+
<id>sign-artifacts</id>
174+
<phase>verify</phase>
175+
<goals>
176+
<goal>sign</goal>
177+
</goals>
178+
</execution>
179+
</executions>
180+
</plugin>
181+
</plugins>
182+
</build>
183+
</profile>
184+
</profiles>
185+
84186
<dependencies>
85187
<dependency>
86188
<groupId>com.squareup.okhttp3</groupId>

0 commit comments

Comments
 (0)