Issue
I want to compile a Minecraft Spigot plugin in JetBrains IntelliJ. The whole thing is done with the help of Maven. But that doesn't really work yet. Every time I want to compile it comes to this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (default) on project Kizume-RPG: Error creating shaded jar: C:\Users\denis\Desktop\Plugins (Zugriff verweigert) -> [Help 1]
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<groupId>de.lenjee</groupId>
<artifactId>Kizume-RPG</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Kizume RPG</name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<outputFile>C:\Users\denis\Desktop\Plugins</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Maybe somebody knows the error. I already googled it, but the solutions are not worked for me.
Solution
<outputFile>C:\Users\denis\Desktop\Plugins</outputFile>
I found that you must specify the java file for it to work, that did the trick for me. You only put the folder, and that seems to be the problem. What I mean by putting the file:
<outputFile>C:\Users\denis\Desktop\Plugins\Plugin.java</outputFile>
Instead of "Plugin.java" you can just put the name you want for your file. I know this is late, but it's for anyone like me who struggled to find an easier solution. Hope this helps anyone still having this issue!
Answered By - L0RD3N
Answer Checked By - Mary Flores (JavaFixing Volunteer)