Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expression type DslEntry must conform to Def.SettingsDefinition in SBT file at line enablePlugins(JavaServerAppPackaging)

I get the message Expression type DslEntry must conform to Def.SettingsDefinition in SBT file at line enablePlugins(JavaServerAppPackaging) i tried refreshing the project but it didn't help. The whole sbt file is mostly generated by the lightbend (former typesafe) activator and looks as follows

import NativePackagerHelper._

name := """ping-backend"""

version := "2.4.0"

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.4.0",
  "com.typesafe.play" %% "play-json" % "2.4.6",
  "org.igniterealtime.smack" % "smack-java7" % "4.1.0",
  "org.igniterealtime.smack" % "smack-tcp" % "4.1.0",
  "org.igniterealtime.smack" % "smack-im" % "4.1.0",
  "org.igniterealtime.smack" % "smack-extensions" % "4.1.0"
)

enablePlugins(JavaServerAppPackaging)

mainClass in Compile := Some("sample.hello.Main")

mappings in Universal ++= {
  // optional example illustrating how to copy additional directory
  directory("scripts") ++
  // copy configuration files to config directory
  contentOf("src/main/resources").toMap.mapValues("config/" + _)
}

// add 'config' directory first in the classpath of the start script,
// an alternative is to set the config file locations via CLI parameters
// when starting the application
scriptClasspath := Seq("../config/") ++ scriptClasspath.value

when running activator run or sbt run in the command line the project runs. I can even build and run it from Intellij, so this is more of an inconvenience then an error, but I would still rather have it resolved. Can someone help me with this?

like image 565
Lukasz Avatar asked Mar 11 '16 11:03

Lukasz


1 Answers

I closed project by File -> close project option and removed all project/, target/ and .idea/ from main and sub projects. Then, I reopened intelliJ and made a fresh import by File -> New -> Project from existing sources -> import project from external model -> select project directory -> sbt.

I believe the issue happened for wrong way of import. Correct way of import fixed it.

like image 108
Niladri Avatar answered Jan 03 '23 11:01

Niladri