title: Maven Failed to Execute Goal org.apache.maven.plugins:maven-surefire-plugin2.22.2 And maven-compiler
body: <p>I get some errors when I try to run the maven test in Intellij. When I try to run the test from maven I get the following maven-sunfire error :
  <b>"Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin".</b> I updated my pom.xml file to different maven-sunfire-plugin versions...</p>
  
  <p>Also when I use the following command :<b> mvn clean install -U </b>, I also get an error.</p>
  
  <p><b>
  "[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on proje
  ct AnimalShelter: Fatal error compiling: invalid flag: --module-path -> [Help 1]"
  </b></p>
  
  <p>I just want to run the test via maven, I tried so many things but maven just won't work. My test are fine, I tested them solo and together via "Run all tests". Just in Maven it won't work. </p>
  
  <p>I searched alot and also tried to <b>delete the .m2 file</b>. Also not working.</p>
  
  <p>I use java version 12</p>
  
  <p>my pom.xml </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;nl.julianlu&lt;/groupId&gt;
      &lt;artifactId&gt;AnimalShelter&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&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.8.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;12&lt;/source&gt;
                      &lt;target&gt;12&lt;/target&gt;
                  &lt;/configuration&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.22.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;printSummary&gt;true&lt;/printSummary&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-controls&lt;/artifactId&gt;
              &lt;version&gt;12&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-graphics&lt;/artifactId&gt;
              &lt;version&gt;12&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-fxml&lt;/artifactId&gt;
              &lt;version&gt;12&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
              &lt;version&gt;5.5.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>My module-info.java</p>
  
  <pre class="lang-java prettyprint-override"><code>module AnimalShelter {
      requires javafx.controls;
      requires javafx.fxml;
  
      opens ui;
      exports ui;
      exports classes;
      exports Interfaces;
  }
  
  </code></pre>