title: Maven can't find FXMLLoader
body: <p>I have a JavaFx project in which <code>Maven install</code> keeps giving me the error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project gui: Compilation failure: Compilation failure:
  [ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[21,19] package javafx.fxml does not exist
  [ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[29,17] cannot find symbol
  [ERROR] symbol:   class FXMLLoader
  [ERROR] location: class gui.AppController
  [ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[29,45] cannot find symbol
  [ERROR] symbol:   class FXMLLoader
  [ERROR] location: class gui.AppController
  </code></pre>
  
  <p>What am I doing wrong? How do I persuade Maven/Eclipse/Java/Whatever find the <code>FXMLLoader</code>?</p>
  
  <p>The project structure has two modules, <code>gui</code> and <code>logic</code>, with the project structure in <a href="https://dzone.com/articles/javafx-on-jdk-11" rel="nofollow noreferrer">this tutorial</a>. My overall project pom is:</p>
  
  <pre><code>&lt;modules&gt;
      &lt;module&gt;logic&lt;/module&gt;
      &lt;module&gt;gui&lt;/module&gt;
  &lt;/modules&gt;
  &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.7.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;11&lt;/source&gt;
                  &lt;target&gt;11&lt;/target&gt;
                  &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                  &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
              &lt;/configuration&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.ow2.asm&lt;/groupId&gt;
                      &lt;artifactId&gt;asm&lt;/artifactId&gt;
                      &lt;version&gt;6.2&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>The pom for the <code>gui</code> module is:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;com.gmail.digitig&lt;/groupId&gt;
      &lt;artifactId&gt;gsn-notator&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  &lt;artifactId&gt;gui&lt;/artifactId&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.gmail.digitig&lt;/groupId&gt;
          &lt;artifactId&gt;logic&lt;/artifactId&gt;
          &lt;version&gt;${project.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;  
          &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
          &lt;artifactId&gt;javafx-controls&lt;/artifactId&gt;
          &lt;version&gt;11-ea+19&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>I don't have anything in the logic module yet, other than a trivial <code>module_info.java</code>. Class <code>gui.AppController</code>, where the error is being reported, is:</p>
  
  <pre><code>package gui;
  
  import java.io.IOException;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.layout.BorderPane;
  
  public class AppController extends BorderPane {
  public AppController() {
      FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("App.fxml"));
      try {
          fxmlLoader.load();
      } catch (IOException exception) {
          throw new RuntimeException(exception);
      }
  }
  </code></pre>
  
  <p>}</p>