Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven compile replies 'No sources to compile' for scala project
    primarykey
    data
    text
    <p>I have the following (single) scala class</p> <pre><code>[ 14253 Oct 30 8:44] ./pom.xml [ 9083 Oct 30 8:30] ./scaladem.iml [ 102 Oct 29 19:21] ./src [ 102 Oct 29 19:21] ./src/main [ 102 Oct 29 19:21] ./src/main/scala [ 102 Oct 29 19:21] ./src/main/scala/com [ 102 Oct 29 19:21] ./src/main/scala/com/blazedb [ 102 Oct 30 8:30] ./src/main/scala/com/blazedb/scalademo [ 4646 Oct 30 8:30] ./src/main/scala/com/blazedb/scalademo/SDemo.scala </code></pre> <p>Here is the applicable section of the pom</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt; &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt; &lt;version&gt;3.1.6&lt;/version&gt; &lt;configuration&gt; &lt;recompileMode&gt;incremental&lt;/recompileMode&gt; &lt;javacArgs&gt; &lt;javacArg&gt;-Xlint:unchecked&lt;/javacArg&gt; &lt;javacArg&gt;-Xlint:deprecation&lt;/javacArg&gt; &lt;/javacArgs&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;scala-compile-first&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;add-source&lt;/goal&gt; &lt;goal&gt;compile&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;scala-test-compile&lt;/id&gt; &lt;phase&gt;process-test-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;testCompile&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>When we run</p> <pre><code>mvn compile </code></pre> <p>We get (notice the 'no sources' ..)</p> <pre><code>[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building SDemo 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ scalademo --- [INFO] No sources to compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ </code></pre> <p>Update: when running the following command</p> <pre><code>$mvn scala:compile -DdisplayCmd=true </code></pre> <p>The compilation succeeds.</p> <p>From suggestion of @badtrumpet I have added the explicit as shown below </p> <pre><code>&lt;sourceDirectory&gt;src/main/scala&lt;/sourceDirectory&gt; </code></pre> <p>And this works even by mvn compile. But that would be an issue for mixed java/scala projects. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload