Skip to content

Scala Compiler on AWS Glue occur decode error when try to execute job using custom spark script jar file. #90

@takat0-h0rikosh1

Description

@takat0-h0rikosh1

Scala Compiler happend below error.

error: IO error while decoding my-scripts.jar with UTF-8 Please try specifying another one using the -encoding option one error found

Although specified Seq("-encoding", "UTF-8") to javacOption and scalacOptions, I dont't understand issue above error.
How should I fix build.sbt.

lazy val scala235 = "2.13.5"
lazy val scala211 = "2.11.12"

ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "myproject"
ThisBuild / organizationName := "myproject"

javacOptions ++= Seq("-encoding", "UTF-8")
scalacOptions ++= Seq("-encoding", "UTF-8")

lazy val commonSettings = Seq(
  assembly / test := {}
)

lazy val scripts = (project in file("scripts"))
  .settings(commonSettings)
  .settings(
    scalaVersion := scala211,
    assembly / assemblyJarName := "my-scripts.jar",
    assembly / assemblyOption := (assembly / assemblyOption).value.copy(cacheOutput = false),
    assembly / assemblyMergeStrategy := {
      case PathList("META-INF", xs @ _*) => MergeStrategy.discard
      case x                             => MergeStrategy.first
    },
    resolvers ++= Seq(
      "aws-glue-etl-artifacts" at "https://aws-glue-etl-artifacts.s3.amazonaws.com/release/"
    ),
    libraryDependencies ++= Seq(
      "com.amazonaws"             % "AWSGlueETL" % "1.0.0" % "provided",
      "software.amazon.awssdk"    % "glue"       % "2.16.63",
      "org.apache.spark"         %% "spark-core" % "2.4.7" % "provided",
      "org.apache.httpcomponents" % "httpclient" % "4.5.13"
    )
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions