I have the following code.
I am trying to create a 'pom.xml' file for a bukkit plugin (Minecraft) using Maven.
However, this gives me the error: 'The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.6 is missing'.
I have tried to trouble shoot a few different solutions but haven't been successful in any.
I would be so grateful for a helping hand!
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>newestfile.here</groupId>
<artifactId>newestplugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.6</version>
<configuration>
<source>19</source>
<target>19</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
CodePudding user response:
The source and target look wrong, are you sure they shouldn't be 1.8? That is the only number I see listed. Double check that and try running mvn compile and see if that didn't fix it.
CodePudding user response:
I changed the version to 3.10.1 and the target to 17 as follows, and the code successfully ran:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>newestfile.here</groupId>
<artifactId>newestplugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version><!--change this value depending on the version or use LATEST-->
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Thanks so much for all your help!
CodePudding user response:
maven-compiler-plugin doesn't have 3.8.6 version. You need to choose some other version. Here is the available version list https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin.