I know this is another question like, this but really - I tested all things that are on internet, and I can't make it work!
Hi! I created GitHub repo: https://github.com/Norbiros/DenoriaBot. When I export this file - everything works fine, but when I add this plugin to server and reload it I have this error:
Could not load 'plugins/DenoriaBot.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:159) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[paper-1.18.1.jar:git-Paper-197]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:285) ~[paper-1.18.1.jar:git-Paper-197]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-197]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-197]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
I looked in every file, but I can't see what I did wrong. Maybe someone will help me...
I'm exporting plugin with command:
mvn clean install
When I'm running this command I have warning (I think it is not important, but IDK):
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] DenoriaBot.jar, JDA-5.0.0-alpha.9.jar, annotations-16.0.1.jar, commons-collections4-4.1.jar, jackson-annotations-2.10.1.jar, jackson-core-2.10.1.jar, jackson-databind-2.10.1.jar, jna-4.4.0.jar, jsr305-3.0.2.jar, nv-websocket-client-2.14.jar, okhttp-3.13.0.jar, okio-1.17.2.jar, opus-java-1.1.1.jar, opus-java-api-1.1.1.jar, opus-java-natives-1.1.1.jar, slf4j-api-1.7.25.jar, trove4j-3.0.3.jar define 1 overlapping resources:
[WARNING] - META-INF/MANIFEST.MF
[WARNING] jackson-core-2.10.1.jar, jackson-databind-2.10.1.jar define 1 overlapping resources:
[WARNING] - META-INF/NOTICE
[WARNING] jackson-annotations-2.10.1.jar, jackson-core-2.10.1.jar, jackson-databind-2.10.1.jar define 1 overlapping resources:
[WARNING] - META-INF/LICENSE
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
CodePudding user response:
I just checked your repository.
The main issue is that everything is in the denoriabot
and not in main folder. So, instead of beeing src/main
it's denoriabot/src/main
. To fix it, you can change it in your pom.xml
, or change the folder itself.
Also, you used github workflows. I suggest you to make auto-run with 2 things:
- Run maven:
- name: Build with Maven
run: mvn install
- Upload artifact to github:
- uses: actions/upload-artifact@v2
name: Upload Artifact
with:
name: FileName.jar
path: target/FileName*.jar