Package expression marked as "unused import"

I have a scala class that defines its package like this

package exporters

The class is under the following directory structure:

src/main/scala/exporters/ExporterManager.scala

When compiling a project with sbt , the following warning appears:

 [warn] /scala/export/src/main/scala/exporters/ExporterManager.scala:1:Unused import [warn] package exporters [warn] ^ [warn] one warning found 

How can I fix this warning?

EDIT:

Here is an excerpt from the class code:

 package exporters import java.util.Date import java.util.concurrent.atomic.AtomicInteger import akka.actor.SupervisorStrategy.Stop import akka.actor._ import com.amazonaws.services.cloudwatch.model.{StandardUnit, MetricDatum, PutMetricDataRequest} ... import scala.collection.JavaConversions._ import scala.collection.mutable.ArrayBuffer import scala.concurrent.duration._ import scala.pickling.Defaults._ import scala.pickling.json._ import scala.util.Try class ExporterManager extends Actor with ActorJsonLogging { def receive = { .... } ... } 

Missed imports for our classes, but nothing special. This is the main Accra Accor.

+6
source share
2 answers

In my case, I used the Play Framework. I used macros to create play.api.libs.json.Reads (play.api.libs.json.Json.reads)

The warnings disappeared as soon as I replaced the macro with code to manually create Reads.

+4
source

Not a solution, but a workaround if your problem is with Play Json macros. It turns out that the error is related to the reads macro, but not in the format macro, so we can take advantage of the fact that Format[X] extends Reads[X] :

 implicit val noteReads: Reads[Note] = Json.format[Note] 
+2
source

All Articles