我在java中使用IronMQ时遇到问题。找不到如何从maven那里得到它。所以把jar下载到了我的lib文件夹中。然后不断出现运行时错误。
[NoClassDefFoundError: com/google/gson/JsonSyntaxException]
现在我陷入了困境。等待支持者的答复。
这个答案来自于他们的支持。
您可以使用这些maven设置,并将它们添加到build.scala文件中。
它使用gson,所以你也需要它。
<repositories>
<repository>
<id>iron-io-repo</id>
<name>Iron.io Maven repository on GitHub</name>
<url>http://iron-io.github.com/maven/repository/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ironmq</groupId>
<artifactId>ironmq</artifactId>
<version>0.0.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
这是我的建筑。这是
val appDependencies = Seq(
// Add your project dependencies here,
"com.google.code.morphia" % "morphia" % "0.99",
"org.mongodb" % "mongo-java-driver" % "2.7.3",
"com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
"com.github.mumoshu" %% "play2-memcached" % "0.2.1-SNAPSHOT",
"com.rabbitmq" % "amqp-client" % "2.8.4",
"com.google.code.gson" % "gson" % "2.1",
"ironmq" % "ironmq" % "0.0.8"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Maven repository" at "http://morphia.googlecode.com/svn/mavenrepo/",
resolvers += "MongoDb Java Driver Repository" at "http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/",
resolvers += "Spy Repository" at "http://files.couchbase.com/maven2",
resolvers += "Iron.io Maven repository on GitHub" at "http://iron-io.github.com/maven/repository/"
)
当然,在那之后运行重载和更新。它应该能成功运行。