Skip to content

Commit

Permalink
Moved to mongojack
Browse files Browse the repository at this point in the history
  • Loading branch information
jroper committed Feb 14, 2013
1 parent 34bdb58 commit c98a7ac
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 40 deletions.
24 changes: 12 additions & 12 deletions build.sbt
Original file line number Original file line Diff line number Diff line change
@@ -1,26 +1,26 @@
// Project info // Project info


name := "play-mongo-jackson-mapper" name := "play-mongojack"


organization := "net.vz.mongodb.jackson" organization := "org.mongojack"


// The version comes from version.sbt, and is generated by the release plugin // The version comes from version.sbt, and is generated by the release plugin


scalaVersion := "2.9.1" scalaVersion := "2.10.0"


// Dependencies // Dependencies


libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"net.vz.mongodb.jackson" % "mongo-jackson-mapper" % "1.4.1", "org.mongojack" % "mongojack" % "2.0.0-RC1",
"com.fasterxml" % "jackson-module-scala" % "1.9.3", "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.1.3",
"play" %% "play" % "2.0" "play" %% "play" % "2.1.0" % "provided"
) )


// Test dependencies // Test dependencies


libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"org.specs2" %% "specs2" % "1.8.2" % "test", "org.specs2" %% "specs2" % "1.13" % "test",
"play" %% "play-test" % "2.0" % "test" "play" %% "play-test" % "2.1.0" % "test"
) )


// Configuration required for deploying to sonatype // Configuration required for deploying to sonatype
Expand All @@ -40,7 +40,7 @@ pomIncludeRepository := { _ => false }
publishArtifact in Test := false publishArtifact in Test := false


pomExtra := ( pomExtra := (
<url>http://github.com/vznet/play-mongo-jackson-mapper</url> <url>http://github.com/jroper/play-mongojack</url>
<inceptionYear>2012</inceptionYear> <inceptionYear>2012</inceptionYear>
<licenses> <licenses>
<license> <license>
Expand All @@ -51,8 +51,8 @@ pomExtra := (
</license> </license>
</licenses> </licenses>
<scm> <scm>
<url>git@github.com:vznet/play-mongo-jackson-mapper.git</url> <url>git@github.com:jroper/play-mongojack.git</url>
<connection>scm:git:git@github.com:vznet/play-mongo-jackson-mapper.git</connection> <connection>scm:git:git@github.com:jroper/play-mongojack.git</connection>
</scm> </scm>
<developers> <developers>
<developer> <developer>
Expand All @@ -62,6 +62,6 @@ pomExtra := (
<roles> <roles>
<role>Author</role> <role>Author</role>
</roles> </roles>
<organization>VZ Netzwerke</organization> <organization>Typesafe</organization>
</developer> </developer>
</developers>) </developers>)
Empty file added logs/application.log
Empty file.
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.12.2
9 changes: 2 additions & 7 deletions project/plugins.sbt
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,10 @@
resolvers ++= Seq( resolvers ++= Seq(
DefaultMavenRepository, DefaultMavenRepository,
Resolver.url("Play", url("http://download.playframework.org/ivy-releases/"))(Resolver.ivyStylePatterns),
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/", "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
"Typesafe Other Repository" at "http://repo.typesafe.com/typesafe/repo/", Resolver.url("sbt-plugin-releases", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
"sbt-idea-repo" at "http://mpeltonen.github.com/maven/",
Resolver.url("sbt-plugin-releases", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns),
"gseitz@github" at "http://gseitz.github.com/maven/"
) )


addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.4")


addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6") addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")


addSbtPlugin("play" % "sbt-plugin" % "2.0") addSbtPlugin("play" % "sbt-plugin" % "2.1.0")
2 changes: 1 addition & 1 deletion src/main/resources/play.plugins
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
1000:play.modules.mongodb.jackson.MongoDBPlugin 1000:play.modules.mongojack.MongoDBPlugin
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package play.modules.mongodb.jackson package play.modules.mongojack


/** /**
* An object that declares the type of its key. This interface serves to just define the type of the key, so that it * An object that declares the type of its key. This interface serves to just define the type of the key, so that it
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,15 @@
package play.modules.mongodb.jackson package play.modules.mongojack


import play.Plugin import play.Plugin
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import org.codehaus.jackson.map.ObjectMapper
import net.vz.mongodb.jackson.internal.MongoJacksonMapperModule
import play.api.Application import play.api.Application
import com.fasterxml.jackson.module.scala.DefaultScalaModule import com.fasterxml.jackson.module.scala.DefaultScalaModule
import net.vz.mongodb.jackson.{MongoCollection, JacksonDBCollection}
import java.util.Locale import java.util.Locale
import java.lang.reflect.ParameterizedType import java.lang.reflect.ParameterizedType
import com.mongodb.{WriteConcern, Mongo, MongoURI, ServerAddress} import com.mongodb.{WriteConcern, Mongo, MongoURI, ServerAddress}
import org.mongojack.{MongoCollection, JacksonDBCollection}
import com.fasterxml.jackson.databind.ObjectMapper
import org.mongojack.internal.MongoJacksonMapperModule


/** /**
* MongoDB Jackson Mapper module for play framework * MongoDB Jackson Mapper module for play framework
Expand Down Expand Up @@ -173,7 +173,7 @@ class MongoDBPlugin(val app: Application) extends Plugin {
} }


// Configure the default object mapper // Configure the default object mapper
val defaultMapper = MongoJacksonMapperModule.configure(new ObjectMapper).withModule(new DefaultScalaModule) val defaultMapper = MongoJacksonMapperModule.configure(new ObjectMapper).registerModule(new DefaultScalaModule)


val globalMapper = configurer map { val globalMapper = configurer map {
_.configure(defaultMapper) _.configure(defaultMapper)
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package play.modules.mongodb.jackson package play.modules.mongojack


import org.codehaus.jackson.map.ObjectMapper import com.fasterxml.jackson.databind.ObjectMapper


/** /**
* Configures an ObjectMapper. Implementations must have a no argument constructor. * Configures an ObjectMapper. Implementations must have a no argument constructor.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,9 @@
package paly.modules.mongodb.jackson; package play.modules.mongojack;


import net.vz.mongodb.jackson.JacksonDBCollection;
import org.junit.Test; import org.junit.Test;
import play.modules.mongodb.jackson.KeyTyped; import org.mongojack.JacksonDBCollection;
import play.modules.mongodb.jackson.MongoDB; import play.modules.mongojack.KeyTyped;
import play.modules.mongojack.MongoDB;
import play.test.FakeApplication; import play.test.FakeApplication;


import javax.persistence.Id; import javax.persistence.Id;
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,14 @@
package play.modules.mongodb.jackson package play.modules.mongojack


import org.specs2.mutable._ import org.specs2.mutable._
import play.api.test._ import play.api.test._
import play.api.test.Helpers._ import play.api.test.Helpers._
import util.Random import util.Random
import reflect.BeanProperty import scala.beans.BeanProperty
import org.codehaus.jackson.annotate.JsonProperty
import org.codehaus.jackson.map.{DeserializationConfig, ObjectMapper}
import net.vz.mongodb.jackson.{JacksonDBCollection, MongoCollection, Id}
import com.mongodb.{WriteConcern, BasicDBObject, Mongo} import com.mongodb.{WriteConcern, BasicDBObject, Mongo}
import org.mongojack.{MongoCollection, Id}
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper}


case class MongoDBSpec() extends Specification { case class MongoDBSpec() extends Specification {


Expand Down Expand Up @@ -183,7 +183,7 @@ class MockObject(@Id val id: String,


class MockGlobalConfigurer extends ObjectMapperConfigurer { class MockGlobalConfigurer extends ObjectMapperConfigurer {
def configure(defaultMapper: ObjectMapper) = def configure(defaultMapper: ObjectMapper) =
defaultMapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true) defaultMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)


def configure(globalMapper: ObjectMapper, collectionName: String, objectType: Class[_], keyType: Class[_]) = globalMapper def configure(globalMapper: ObjectMapper, collectionName: String, objectType: Class[_], keyType: Class[_]) = globalMapper
} }
Expand All @@ -192,7 +192,7 @@ class MockPerCollectionConfigurer extends ObjectMapperConfigurer {
def configure(defaultMapper: ObjectMapper) = defaultMapper def configure(defaultMapper: ObjectMapper) = defaultMapper


def configure(globalMapper: ObjectMapper, collectionName: String, objectType: Class[_], keyType: Class[_]) = def configure(globalMapper: ObjectMapper, collectionName: String, objectType: Class[_], keyType: Class[_]) =
globalMapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true) globalMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)
} }


@MongoCollection(name = "blah") @MongoCollection(name = "blah")
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.0.1-SNAPSHOT" version in ThisBuild := "2.0.0-SNAPSHOT"

0 comments on commit c98a7ac

Please sign in to comment.