Scala compiler expects package?

Skip to first unread message

Shannon Carey

Apr 26, 2017, 8:21:47 PM4/26/17
to scala-user
I'm getting errors like this one when I have a .java file in my generated-sources (in Maven) that does not have a package declaration.

[ERROR] /..../target/generated-sources/avro/ error: `package' expected but `public' found.

[INFO] public class destination_intent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {

[INFO] ^

The error appears to be coming from Do you agree that this is a problem with the Scala compiler? Does anyone know of a workaround?

I understand that using the default package is not desirable, but in this case (using an Avro schema generated from a Parquet file) it is difficult to avoid.


Adriaan Moors

Apr 26, 2017, 9:28:11 PM4/26/17
to Shannon Carey, scala-user

Sounds like a bug to me. Does the generated file contain an annotation before the class definition at line 8 by any chance?
Please file a ticket at, including the lines leading up to the class definition in your report.


You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit
Reply all
Reply to author
0 new messages