title: “value $ is not a member of StringContext” - Missing Scala plugin?
body: <p>I'm using maven with scala archetype. I'm getting that error:</p>
  
  <blockquote>
    <p>“value $ is not a member of StringContext” </p>
  </blockquote>
  
  <p>I already tried to add several things in pom.xml, but nothing worked very well...</p>
  
  <p>My code:</p>
  
  <pre><code>import org.apache.spark.ml.evaluation.RegressionEvaluator
  import org.apache.spark.ml.regression.LinearRegression
  import org.apache.spark.ml.tuning.{ParamGridBuilder, TrainValidationSplit}
  // To see less warnings
  import org.apache.log4j._
  Logger.getLogger("org").setLevel(Level.ERROR)
  
  
  // Start a simple Spark Session
  import org.apache.spark.sql.SparkSession
  val spark = SparkSession.builder().getOrCreate()
  
  // Prepare training and test data.
  val data = spark.read.option("header","true").option("inferSchema","true").format("csv").load("USA_Housing.csv")
  
  // Check out the Data
  data.printSchema()
  
  // See an example of what the data looks like
  // by printing out a Row
  val colnames = data.columns
  val firstrow = data.head(1)(0)
  println("\n")
  println("Example Data Row")
  for(ind &lt;- Range(1,colnames.length)){
    println(colnames(ind))
    println(firstrow(ind))
    println("\n")
  }
  
  ////////////////////////////////////////////////////
  //// Setting Up DataFrame for Machine Learning ////
  //////////////////////////////////////////////////
  
  // A few things we need to do before Spark can accept the data!
  // It needs to be in the form of two columns
  // ("label","features")
  
  // This will allow us to join multiple feature columns
  // into a single column of an array of feautre values
  import org.apache.spark.ml.feature.VectorAssembler
  import org.apache.spark.ml.linalg.Vectors
  
  // Rename Price to label column for naming convention.
  // Grab only numerical columns from the data
  val df = data.select(data("Price").as("label"),$"Avg Area Income",$"Avg Area House Age",$"Avg Area Number of Rooms",$"Area Population")
  
  // An assembler converts the input values to a vector
  // A vector is what the ML algorithm reads to train a model
  
  // Set the input columns from which we are supposed to read the values
  // Set the name of the column where the vector will be stored
  val assembler = new VectorAssembler().setInputCols(Array("Avg Area Income","Avg Area House Age","Avg Area Number of Rooms","Area Population")).setOutputCol("features")
  
  // Use the assembler to transform our DataFrame to the two columns
  val output = assembler.transform(df).select($"label",$"features")
  
  
  // Create a Linear Regression Model object
  val lr = new LinearRegression()
  
  // Fit the model to the data
  
  // Note: Later we will see why we should split
  // the data first, but for now we will fit to all the data.
  val lrModel = lr.fit(output)
  
  // Print the coefficients and intercept for linear regression
  println(s"Coefficients: ${lrModel.coefficients} Intercept: ${lrModel.intercept}")
  
  // Summarize the model over the training set and print out some metrics!
  // Explore this in the spark-shell for more methods to call
  val trainingSummary = lrModel.summary
  
  println(s"numIterations: ${trainingSummary.totalIterations}")
  println(s"objectiveHistory: ${trainingSummary.objectiveHistory.toList}")
  
  trainingSummary.residuals.show()
  
  println(s"RMSE: ${trainingSummary.rootMeanSquaredError}")
  println(s"MSE: ${trainingSummary.meanSquaredError}")
  println(s"r2: ${trainingSummary.r2}")
  </code></pre>
  
  <p>and my pom.xml is that:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
  
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;test&lt;/groupId&gt;
    &lt;artifactId&gt;outrotest&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;${project.artifactId}&lt;/name&gt;
    &lt;description&gt;My wonderfull scala app&lt;/description&gt;
    &lt;inceptionYear&gt;2015&lt;/inceptionYear&gt;
    &lt;licenses&gt;
      &lt;license&gt;
        &lt;name&gt;My License&lt;/name&gt;
        &lt;url&gt;http://....&lt;/url&gt;
        &lt;distribution&gt;repo&lt;/distribution&gt;
      &lt;/license&gt;
    &lt;/licenses&gt;
  
    &lt;properties&gt;
      &lt;maven.compiler.source&gt;1.6&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.6&lt;/maven.compiler.target&gt;
      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
      &lt;scala.version&gt;2.11.5&lt;/scala.version&gt;
      &lt;scala.compat.version&gt;2.11&lt;/scala.compat.version&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
        &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
        &lt;version&gt;${scala.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
        &lt;artifactId&gt;spark-mllib_2.11&lt;/artifactId&gt;
        &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
        &lt;artifactId&gt;spark-core_2.11&lt;/artifactId&gt;
        &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
        &lt;artifactId&gt;spark-sql_2.11&lt;/artifactId&gt;
        &lt;version&gt;2.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.databricks&lt;/groupId&gt;
        &lt;artifactId&gt;spark-csv_2.11&lt;/artifactId&gt;
        &lt;version&gt;1.5.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Test --&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.11&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.specs2&lt;/groupId&gt;
        &lt;artifactId&gt;specs2-junit_${scala.compat.version}&lt;/artifactId&gt;
        &lt;version&gt;2.4.16&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.specs2&lt;/groupId&gt;
        &lt;artifactId&gt;specs2-core_${scala.compat.version}&lt;/artifactId&gt;
        &lt;version&gt;2.4.16&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.scalatest&lt;/groupId&gt;
        &lt;artifactId&gt;scalatest_${scala.compat.version}&lt;/artifactId&gt;
        &lt;version&gt;2.2.4&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;sourceDirectory&gt;src/main/scala&lt;/sourceDirectory&gt;
      &lt;testSourceDirectory&gt;src/test/scala&lt;/testSourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;!-- see http://davidb.github.com/scala-maven-plugin --&gt;
          &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
          &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2.0&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;compile&lt;/goal&gt;
                &lt;goal&gt;testCompile&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;args&gt;
                  &lt;!--&lt;arg&gt;-make:transitive&lt;/arg&gt;--&gt;
                  &lt;arg&gt;-dependencyfile&lt;/arg&gt;
                  &lt;arg&gt;${project.build.directory}/.scala_dependencies&lt;/arg&gt;
                &lt;/args&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.18.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;useFile&gt;false&lt;/useFile&gt;
            &lt;disableXmlReport&gt;true&lt;/disableXmlReport&gt;
            &lt;!-- If you have classpath issue like NoDefClassError,... --&gt;
            &lt;!-- useManifestOnlyJar&gt;false&lt;/useManifestOnlyJar --&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*Test.*&lt;/include&gt;
              &lt;include&gt;**/*Suite.*&lt;/include&gt;
            &lt;/includes&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I have no idea about how to fix it. Does anybody have any idea?</p>