I am trying to use the Mailer Plugin in my play! 2 Java Application.
I followed the Instructions given in the Readme File but the Module doesn’t show up in my Application’s Dependencies.
So when I try to compile it play! gives me an error:
object plugin is not a member of package com.typesafe
I tried to reload the project and double-checked the files in /project. Nothing worked so far.
Is there a way to force play! to check the application’s dependencies?
Update:
Ok, new Error Message. I deleted /project/project/, /project/target/ and /target/. Next time I started play! it took quite some time to get all the Modules. It did not download the Mailer-Plugin.
But now I get:
play.api.PlayException: Cannot load plugin [Plugin [com.typesafe.plugin.CommonsMailerPlugin] cannot been instantiated.]
followed by:
Caused by: java.lang.ClassNotFoundException: com.typesafe.plugin.CommonsMailerPlugin
Any Ideas?
Update 2:
Okay, i fixed this by downloading the play-plugins-mailer_2.9.1-2.0.4.jar directly from typesafe and putting it into /lib. This is definitely not the right way, but at least it works for now.
The .jar I needed for my play! 2.0.3 project: http://repo.typesafe.com/typesafe/releases/com/typesafe/play-plugins-mailer_2.9.1/2.0.4/
Update 3:
Content of relevant Files:
Build.scala:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "thesis"
val appVersion = "0.9"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.4"
)
val main = PlayProject(appName, appVersion, mainLang = JAVA).settings(
lessEntryPoints <<= baseDirectory(_ / "app" / "assets" / "stylesheets" ** "bootstrap.less"),
templatesImport += "helper._",
templatesImport += "views.html.Helpers._"
)
}
build.properties:
sbt.version=0.11.3
plugins.sbt:
// Comment to get more information during initialization
logLevel := Level.Info
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.3")
conf/play.plugins:
1500:com.typesafe.plugin.CommonsMailerPlugin
Okay, in order to get play! to manage my dependencies I had to create a new project copy over the old files (excluding already compiled code), edit the
Build.scalaand reload/compile the project inside the play! console.Now it works! Mailer Plugin gets downloaded, compiled and
play dependencieslists it.