Skip to content

Commit df8638c

Browse files
author
elbuo8
committed
Cleaner readme and split instruction
1 parent 97c0b6c commit df8638c

2 files changed

Lines changed: 61 additions & 60 deletions

File tree

README.md

Lines changed: 9 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public class SendGridExample {
2828
}
2929
}
3030
```
31-
Compile and run this example with `javac -classpath sendgrid-1.2.0-jar.jar:. SendGridExample.java && java -classpath sendgrid-1.2.0-jar.jar:. SendGridExample`
31+
Compile and run this example with
32+
33+
```bash
34+
$ javac -classpath sendgrid-1.2.0-jar.jar:. SendGridExample.java && java -classpath sendgrid-1.2.0-jar.jar:. SendGridExample
35+
```
3236

3337
## Installation
3438

@@ -42,7 +46,7 @@ Add the following to your build.gradle file in the root of your project.
4246
...
4347
dependencies {
4448
...
45-
compile 'com.sendgrid:sendgrid-java:1.1.0'
49+
compile 'com.sendgrid:sendgrid-java:1.2.0'
4650
}
4751
4852
repositories {
@@ -234,73 +238,18 @@ sendgrid.addFilter("bcc", "email", "example@example.com");
234238
The existing tests in the `src/test` directory can be run using gradle with the following command:
235239

236240
```bash
237-
./gradlew test -i
241+
$ ./gradlew test -i
238242
```
239243

240244
## Generating the jar
241245

242246
```bash
243-
./gradlew build
244-
```
245-
246-
(If you don't have gradle install it. If on a mac, you can run `brew install gradle`)
247-
248-
## Publishing to Maven
249-
250-
This only works if you have the correct permissions - for admins only basically.
251-
252-
Let's begin with the permissions.
253-
254-
```
255-
cp gradle.properties.example ~/.gradle/gradle.properties
256-
```
257-
258-
Edit that file and set your `sonatypeUsername` and sonatypePassword`. You also need to set the values for your keys. Here's how to list/create them. [1](http://central.sonatype.org/pages/working-with-pgp-signatures.html).
259-
260-
```
261-
gpg --list-keys
262-
gpg --gen-key
263-
```
264-
265-
Set the signing.KeyId, signing.password, and the signing.secretKeyRingFile.
266-
267-
The signing.KeyId is the 'pub' one. It's the part of your list of keys that looks something like this: `2048R/5D64A177`. So in this scenario it would be `5D64A177`. [1](http://www.gradle.org/docs/current/userguide/signing_plugin.html) [2](http://yennicktrevels.com/blog/2013/10/11/automated-gradle-project-deployment-to-sonatype-oss-repository/)
268-
269-
The signing.password is the password you used when generating this key. It could be blank if you didn't use a password.
270-
271-
The signing.secretKeyRingFile is the path to the secring.gpg.
272-
273-
Now, upload that key to the keyserver.
274-
275-
```
276-
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 5D64A177
277-
```
278-
279-
Now, you can finally upload! Ah, Java!
280-
281-
```
282-
./gradlew uploadArchives
247+
$ ./gradlew build
283248
```
284249

285-
Login to [Sonatype](https://oss.sonatype.org/index.html#stagingRepositories).
286-
287-
Go to [staging repositories page](https://oss.sonatype.org/index.html#stagingRepositories).
288-
289-
Click 'Close' with the archive selected.
290-
291-
![](https://raw.githubusercontent.com/sendgrid/sendgrid-java/master/maven-help.png)
292-
293-
Wait a few minutes, and refresh the staging repositories page.
294-
295-
Check the box for the SendGrid repo again and this time click 'Release'.
296-
297-
You're all done.
298-
299-
[Further help](https://github.com/sendgrid/sendgrid-java/pull/15).
300-
301250
## Example App
302251

303-
We have an example app using this library. This can be helpful to get a grasp on implementing it in your own app.
252+
We have an example app using this library. This can be helpful to get a grasp on implementing it in your own app.
304253

305254
[github.com/scottmotte/sendgrid-java-example](http://github.com/scottmotte/sendgrid-java-example)
306255

publishing.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Publishing to Maven
2+
3+
This only works if you have the correct permissions - for admins only basically.
4+
5+
Let's begin with the permissions.
6+
7+
```
8+
cp gradle.properties.example ~/.gradle/gradle.properties
9+
```
10+
11+
Edit that file and set your `sonatypeUsername` and sonatypePassword`. You also need to set the values for your keys. Here's how to list/create them. [1](http://central.sonatype.org/pages/working-with-pgp-signatures.html).
12+
13+
```
14+
gpg --list-keys
15+
gpg --gen-key
16+
```
17+
18+
Set the signing.KeyId, signing.password, and the signing.secretKeyRingFile.
19+
20+
The signing.KeyId is the 'pub' one. It's the part of your list of keys that looks something like this: `2048R/5D64A177`. So in this scenario it would be `5D64A177`. [1](http://www.gradle.org/docs/current/userguide/signing_plugin.html) [2](http://yennicktrevels.com/blog/2013/10/11/automated-gradle-project-deployment-to-sonatype-oss-repository/)
21+
22+
The signing.password is the password you used when generating this key. It could be blank if you didn't use a password.
23+
24+
The signing.secretKeyRingFile is the path to the secring.gpg.
25+
26+
Now, upload that key to the keyserver.
27+
28+
```
29+
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 5D64A177
30+
```
31+
32+
Now, you can finally upload! Ah, Java!
33+
34+
```
35+
./gradlew uploadArchives
36+
```
37+
38+
Login to [Sonatype](https://oss.sonatype.org/index.html#stagingRepositories).
39+
40+
Go to [staging repositories page](https://oss.sonatype.org/index.html#stagingRepositories).
41+
42+
Click 'Close' with the archive selected.
43+
44+
![](https://raw.githubusercontent.com/sendgrid/sendgrid-java/master/maven-help.png)
45+
46+
Wait a few minutes, and refresh the staging repositories page.
47+
48+
Check the box for the SendGrid repo again and this time click 'Release'.
49+
50+
You're all done.
51+
52+
[Further help](https://github.com/sendgrid/sendgrid-java/pull/15).

0 commit comments

Comments
 (0)