Code Monkey home page Code Monkey logo

Comments (9)

Vshnv avatar Vshnv commented on June 20, 2024 1

Ah sorry, this is due to the lack of documentation atm. Ill get to writing a proper guide soon.
The gradle plugin version is different from the library version.

to use the latest library version, in your project root create a file called "gradle.properties"
in it, add slimjar.version = 1.2.3 and reload the gradle project

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

Also, two side questions:

  1. is there a way to make SlimJar drop its own dependencies in the directory defined by downloadDirectoryPath()? If not, this would also be a great addition to not pollute users' HOME directories. (Since for example, Pterodactyl doesn't support folder names beginning with a dot, so it places the .slimjar folder in a directory named ?)
  2. SlimJar is currently deleting(?) the dependencies it loads after startup, can this behaviour be changed somehow?

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Yes, we are currently planning to provide users an option to provide their own logger, reason being java's internal logger not being the most useful and we dont want to add another logger framework on just for the library.
About the other questions:

  1. Currently it seems we havent provided a way to do that. We'll make sure to include that in the next patch, thank you for the suggestion!

  2. It shouldnt be deleting dependencies unless the dependency file changes. Could you confirm if you're seeing this happening as this is unintended behaviour?

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

Could you confirm if you're seeing this happening as this is unintended behaviour?

Can confirm that when using ApplicationBuilder.appending("Plan").downloadDirectoryPath(Paths.get(getDataFolder().getAbsolutePath()).resolve("libraries")).build(); to load deps with SlimJar, after a while, the whole libraries folder disappears from the plugin's data folder. This happens in a Pterodactyl Docker container running Java 16.

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Alright, Ill try to replicate the bug and release a fix asap. Thanks for the report!

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

Additionally, SlimJar seems to have issues finding the relocated JARs on Windows, doesn't work at all. On Pterodactyl (and probably on any *nix) works just fine.

I'll try and see if this is related to spaces in the file path.

[23:00:31 INFO] [Plan]: Loading dependencies, this might take a while...
[23:00:37 WARN]: Error loading plugin Plan
io.github.slimjar.injector.InjectionFailedException: SlimJar failed to inject dependency: name -> Dependency{groupId='mysql', artifactId='mysql-connector-java', version='8.0.25', snapshotId='null', transitive=[Dependency{groupId='com.google.protobuf', artifactId='protobuf-java', version='3.11.4', snapshotId='null', transitive=[]}]}
        at io.github.slimjar.injector.SimpleDependencyInjector.injectDependencies(SimpleDependencyInjector.java:63) ~[?:?]
        at io.github.slimjar.injector.SimpleDependencyInjector.inject(SimpleDependencyInjector.java:50) ~[?:?]
        at io.github.slimjar.app.builder.InjectingApplicationBuilder.build(InjectingApplicationBuilder.java:55) ~[?:?]
        at com.djrapitops.plan.PlanBungee.onLoad(PlanBungee.java:63) ~[?:?]
        at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:398) ~[waterfall-1.17-443.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:34188b3:443]
        at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:300) ~[waterfall-1.17-443.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:34188b3:443]
        at net.md_5.bungee.BungeeCord.start(BungeeCord.java:278) ~[waterfall-1.17-443.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:34188b3:443]
        at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:80) ~[waterfall-1.17-443.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:34188b3:443]
        at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[waterfall-1.17-443.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:34188b3:443]
Caused by: java.nio.file.NoSuchFileException: F:\Software%20Development\minecraft\waterfall%20dev%20server\plugins\Plan\libraries\mysql\mysql-connector-java\8.0.25\relocated\Plan\mysql-connector-java-8.0.25.jar
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
        at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53) ~[?:?]
        at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38) ~[?:?]
        at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:199) ~[?:?]
        at java.nio.file.Files.readAttributes(Files.java:1843) ~[?:?]
        at java.util.zip.ZipFile$Source.get(ZipFile.java:1212) ~[?:?]
        at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:706) ~[?:?]
        at java.util.zip.ZipFile.<init>(ZipFile.java:240) ~[?:?]
        at java.util.zip.ZipFile.<init>(ZipFile.java:171) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:348) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:319) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:258) ~[?:?]
        at io.github.slimjar.injector.loader.InstrumentationInjectable.inject(InstrumentationInjectable.java:70) ~[?:?]
        at io.github.slimjar.injector.SimpleDependencyInjector.injectDependencies(SimpleDependencyInjector.java:60) ~[?:?]
        ... 8 more

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

That is an issue from an older version. Try creating a "gradle.properties" file and adding slimjar.version = 1.2.3 to it

It occurs due to the space in the file name

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

That is an issue from an older version. Try creating a "gradle.properties" file and adding slimjar.version = 1.2.3 to it

It occurs due to the space in the file name

Ah, thanks! Is 1.2.3 going to appear in the Gradle plugin portal? I'm trying to use your repo but gradle wants to add .gradle.plugin to the package name and thus cannot find the artifact in your repo 😅

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

This one was my fault 😅 our plugin had a couple of lines of code (which I totally forgot about) that were deleting the dependency cache, apologies!

from slimjar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.