|
| 1 | +MessagePack for Java |
| 2 | +=== |
| 3 | + |
| 4 | +[MessagePack](http://msgpack.org) is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves. |
| 5 | + |
| 6 | + * Message Pack specification: <https://github.com/msgpack/msgpack/blob/master/spec.md> |
| 7 | + |
| 8 | +## Quick Start |
| 9 | + |
| 10 | +For Maven users: |
| 11 | +``` |
| 12 | +<dependency> |
| 13 | + <groupId>org.msgpack</groupId> |
| 14 | + <artifactId>msgpack-core</artifactId> |
| 15 | + <version>0.7.0</version> |
| 16 | +</dependency> |
| 17 | +``` |
| 18 | + |
| 19 | +For sbt users: |
| 20 | +``` |
| 21 | +libraryDependencies += "org.msgpack" % "msgpack-core" % "0.7.0" |
| 22 | +``` |
| 23 | + |
| 24 | + |
| 25 | +## For Developers |
| 26 | + |
| 27 | +msgpack-java uses [sbt](http://www.scala-sbt.org/) for building the projects. For the basic usage of sbt, see: |
| 28 | + * [Building Java projects with sbt](http://xerial.org/blog/2014/03/24/sbt/) |
| 29 | + |
| 30 | +### Basic sbt commands |
| 31 | +Enter the sbt console: |
| 32 | +``` |
| 33 | +$ ./sbt |
| 34 | +``` |
| 35 | + |
| 36 | +Then you can run |
| 37 | +``` |
| 38 | +> ~compile # Compile source codes |
| 39 | +> ~test:compile # Compile both source and test codes |
| 40 | +> ~test # Run tests upon source code change |
| 41 | +> ~test-only *MessagePackTest # Run tests in the specified class |
| 42 | +> ~test-only *MessagePackTest -- -n prim # Run the test tagged as "prim" |
| 43 | +> project msgpack-core # Focus on a specific project |
| 44 | +> package # Create a jar file in the target folder of each project |
| 45 | +> findbugs # Produce findbugs report |
| 46 | +``` |
| 47 | + |
| 48 | +### Publishing |
| 49 | + |
| 50 | +`` |
| 51 | +> publishLocal # Install to local .ivy2 repository |
| 52 | +> publishM2 # Install to local .m2 Maven repository |
| 53 | +> publishSigned # Publish GPG signed artifacts to the Sonatype repository |
| 54 | +> sonatypeRelease # Publish to the Maven Central (It will be synched within less than 4 hours) |
| 55 | +``` |
| 56 | +
|
| 57 | +For publishing to Maven central, msgpack-java uses [sbt-sonatype](https://github.com/xerial/sbt-sonatype) plugin. Set Sonatype account information (user name and password) in the global sbt settings. To protect your password, never include this file in your project. |
| 58 | +
|
| 59 | +___$HOME/.sbt/(sbt-version)/sonatype.sbt___ |
| 60 | +
|
| 61 | +``` |
| 62 | +credentials += Credentials("Sonatype Nexus Repository Manager", |
| 63 | + "oss.sonatype.org", |
| 64 | + "(Sonatype user name)", |
| 65 | + "(Sonatype password)") |
| 66 | +``` |
| 67 | +
|
| 68 | +### Project Structure |
| 69 | +
|
| 70 | +``` |
| 71 | +msgpack-core # Contains packer/unpacker implementation that never uses third-party libraries |
| 72 | +``` |
0 commit comments