title: Maven Compilation Error: package javafx does not exist (with javafx-maven-plugin)
body: <p>I am doing a class project, requiring using Maven as build tool for a JavaFx project.</p>
  
  <p>This is my pom.xml setting, where I use 2 plugins. Per my understanding: <code>maven-compiler-plugin</code> is to enforce java jdk 1.8 as compiler, and <code>javafx-maven-plugin</code> to auto download javafx library.</p>
  
  <p>Also, my main launcher Main.java file is located at <code>src/main/java/Main/Main.java</code>. <code>pom.xml</code> is at the same level as <code>src</code> folder.</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.5.1&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;fork&gt;true&lt;/fork&gt;
                    &lt;compilerVersion&gt;1.8&lt;/compilerVersion&gt;
                    &lt;verbose&gt;true&lt;/verbose&gt;
                    &lt;source&gt;1.8&lt;/source&gt;
                    &lt;target&gt;1.8&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;com.zenjava&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;8.8.3&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;mainClass&gt;Main.Main&lt;/mainClass&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;properties&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>And I execute <code>mvn package</code> command under the same directory of pom.xml, and it seems the <code>maven-compiler-plugin 3.5.1</code> was downloaded fine.</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building PhotoshopUltraLight 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  Downloading: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.pom
  Downloaded: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.pom (10 KB at 23.3 KB/sec)
  Downloading: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom
  Downloaded: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom (12 KB at 170.3 KB/sec)
  Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/27/maven-parent-27.pom
  Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/27/maven-parent-27.pom (40 KB at 446.7 KB/sec)
  Downloading: 
  https://repo.maven.apache.org/maven2/org/apache/apache/17/apache-17.pom
  Downloaded: 
  https://repo.maven.apache.org/maven2/org/apache/apache/17/apache-17.pom (16 KB at 261.3 KB/sec)
  Downloading: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.jar
  Downloaded: 
  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.jar (50 KB at 778.5 KB/sec)
  </code></pre>
  
  <p>However, compilation always failed.</p>
  
  <pre><code>[ERROR] COMPILATION ERROR :
  [INFO] -------------------------------------------------------------
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/ImageLayer.java:[3,25] error: package javafx.scene.image does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/ImageLayer.java:[4,25] error: package javafx.scene.image does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/ImageLayer.java:[5,26] error: package javafx.scene.layout does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[4,25] error: package javafx.beans.value does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[5,25] error: package javafx.beans.value does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[6,22] error: package javafx.geometry does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[7,27] error: package javafx.scene.control does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[8,27] error: package javafx.scene.control does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[9,26] error: package javafx.scene.layout does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[10,26] error: package javafx.scene.layout does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[11,25] error: package javafx.scene.paint does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/Layer.java:[12,25] error: package javafx.scene.shape does not exist
  [ERROR] /mnt/c/Users/meifi/Documents/Photoshop-Ultra-Light/src/main/java/Layers/ImageLayer.java:[11,4] error: cannot find symbol
  [ERROR]   symbol:   class ImageView
  location: class ImageLayer
  </code></pre>
  
  <p>I have no clue which step was wrong... Any thought would be very appreciated.</p>