Я делаю проект класса, требующий использования Maven в качестве инструмента для сборки проекта JavaFx.
Это моя настройка pom.xml, где я использую 2 плагина. Насколько я понимаю: maven-compiler-plugin
означает принудительное использование java jdk 1.8 в качестве компилятора и javafx-maven-plugin
для автоматической загрузки библиотеки javafx.
Кроме того, мой основной файл запуска Main.java находится по адресу src/main/java/Main/Main.java
. pom.xml
находится на том же уровне, что и папка src
.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<fork>true</fork>
<compilerVersion>1.8</compilerVersion>
<verbose>true</verbose>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>Main.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
И я выполняю команду mvn package
в том же каталоге pom.xml, и, похоже, maven-compiler-plugin 3.5.1
загружен нормально.
[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)
Однако компиляция всегда не удалась.
[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
Понятия не имею, какой шаг был неправильным ... Любая мысль будет очень признательна.