[Maven] The plugin is not compiling ZLib
hugo4715 opened this issue · 21 comments
Hello,
I have forked the rewrite branch, to add translations to the plugin.
But when I export it, and run the server, the plugin throw a classNotFoundException
and if I open the jar with winrar, there is no fr.zlib.*******
Do you know why?
Error: http://pastebin.com/aSCexaMZ
pom.xml: The one in the repo
Thanks :p
PS: Sorry for my english, I'm french
I compile it with mvn clean install
and it's just fine here, just like any other dependency using Maven shading features.
The output of the Maven build should be like this:
$ mvn clean install
[...]
[INFO] --- maven-shade-plugin:2.3:shade (default) @ SpectatorPlus ---
[...]
[INFO] Including fr.zcraft:zlib:jar:0.99-SNAPSHOT in the shaded jar.
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /home/amaury/Programmes/Minecraft/CraftBukkit/Plugins/SpectatorPlus/SpectatorPlus/target/SpectatorPlus-B2.1.jar with /home/amaury/Programmes/Minecraft/CraftBukkit/Plugins/SpectatorPlus/SpectatorPlus/target/SpectatorPlus-B2.1-shaded.jar
[INFO] Dependency-reduced POM written at: /home/amaury/Programmes/Minecraft/CraftBukkit/Plugins/SpectatorPlus/SpectatorPlus/dependency-reduced-pom.xml
[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.496s
[INFO] Finished at: Fri Dec 18 13:33:57 CET 2015
[INFO] Final Memory: 24M/305M
[INFO] ------------------------------------------------------------------------
Just to be sure, Maven is REQUIRED: you cannot compile through an « export to JAR »-like feature of your IDE bypassing Maven. And don't use the original-SpectatorPlus-B2.1.jar
as it's the JAR without the shadings.
The name of the file in your error log (SpectatorPlus.jar
) is not the same as the file name generated by Maven, so I think the problem is here.
If the problem is not here, you may have a problem downloading the dependencies? Can you post your Maven log?
Oh, another thing: the rewrite
branch is NOT a stable branch yet! Accept bugs if you're using it, as I'm still working on it.
I'm very new to Maven, and I'm using the Eclipse IDE maven project.
I will install the maven cmd now, and keep you up to date.
You should be able to use Maven from Eclipse if you don't like commands—but use Maven, really Maven, not the export feature :) .
I will add a build on my Jenkins, hang on.
On Fri, 18 Dec 2015 12:46 pm Amaury Carrade [email protected]
wrote:
You should be able to use Maven from Eclipse if you don't like
commands—but use Maven, really Maven, not the export feature :) .—
Reply to this email directly or view it on GitHub
#57 (comment)
.
Referencing PR #56 for organisational purposes.
I found a way to use the maven "real installation" inside eclipse, but now some ressources don't get exported :(
Error: http://pastebin.com/nbN5w122
I see you are using SpectatorPlus-B2.1-shaded.jar
; there should be another file SpectatorPlus-B2.1.jar
. In fact the shaded file should replace SpectatorPlus-B2.1.jar
—maybe it's more than just a replacement and the problem is here.
In my system I don't even have the SpectatorPlus-B2.1-shaded.jar
file.
If the problem is not here, what are the Maven goals you are using?
The command used by eclipse to build it is "maven clean" and then "maven install"
Maven install log: http://pastebin.com/teUEGLzW
The maven build need a goal and I don't know what I should put there
The goal should be « clean install
».
Looking at the log, it should be fine:
[INFO] Copying 3 resources to .
I'll check if this is not a problem on our side, due to the fact I renamed a config file and @pgmann is not using the standard Maven structure so resources files needs to be listed in the POM.
...The config part was really a bug on our side. Fixed, commit incoming.
I did not noticed the bug because the config.yml
file was already on my development server, and before I added the explicit config file copy (saveDefaultConfig()
) to keep the comments, the file was reconstructed by the configuration manager (...without the comments).
Fixed. The error you got maybe a write permission problem, if you can't prevent it just remove the clean
goal.
It's better to use the clean
goal as sometimes, Maven don't recompile all classes even when needed, and it lead to ClassNotFoundError
s and similars. But without, just run mvn clean
or delete the target/
directory if this happens.
Found another bug when doing "/spec on" :p
Fixed.
Reminder:
Oh, another thing: the
rewrite
branch is NOT a stable branch yet! Accept bugs if you're using it, as I'm still working on it.
:)