Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The jar without excluding some dependencies in shadowJar is a little bit less #897

Closed
2 tasks done
ellet0 opened this issue May 14, 2024 · 3 comments
Closed
2 tasks done
Labels
bug Confirmed bugs or reports that are very likely to be bugs. low-priority Low priority to be addressed.

Comments

@ellet0
Copy link
Contributor

ellet0 commented May 14, 2024

What happened?

  1. Go to build.gradle in the shadowJar block
  2. Run ./gradlew shadowJar and rename the output jar to anything different so it won't replaced with the new one
  3. Replace minimize block that has exlcude (inside it) with only minimize()
  4. Run ./gradlew shadowJar once again

You will notice the old jar size is (26.2 MB) while the new one is (21 MB)

and it is supposed to be the exact opposite, excluding some dependencies should save some space, not making the jar file size a little bit bigger, I might be wrong (I'm not sure if this issue from my side) or it might be a bug in the shadow jar or it could be that excluding some dependencies manually would disable the minimize() process provided by shadow jar and will only exclude what you want to exclude


minimize {
        exclude(dependency('org.apache.logging.log4j:.*:.*'))
        exclude(dependency('com.formdev:.*:.*'))
        exclude(dependency('com.github.jnr:.*:.*'))
        exclude(dependency('com.github.hypfvieh:.*:.*'))
        exclude(dependency('org.apache.commons:commons-compress:.*'))
    }

What the docs say:

image

In either case, it is worth the try, usually the jar file size should be as less as possible

Operating System

macOS

Relevant log output

This is not a bug

Additional Information

image

Is this actually a launcher bug?

  • I am sure this is a bug with the launcher and not an issue with running Minecraft

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ellet0 ellet0 added bug Confirmed bugs or reports that are very likely to be bugs. triage Issue has not been looked at to classify and validate. labels May 14, 2024
@RyanTheAllmighty RyanTheAllmighty added low-priority Low priority to be addressed. and removed triage Issue has not been looked at to classify and validate. labels May 17, 2024
@ellet0
Copy link
Contributor Author

ellet0 commented May 18, 2024

Closing this issue, I will try to focus on more important things next time.

Thank you for your understanding.

@ellet0 ellet0 closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
@Doomsdayrs
Copy link
Collaborator

I am a bit confused, why close this?

@ellet0
Copy link
Contributor Author

ellet0 commented May 18, 2024

I am a bit confused, why close this?

It might be misleading because exclude in the minimize might exclude things from being minimized, because of a reflection for example, and not exclude extra things from the jar, I tested both versions of the jars, and both work without any errors like ClassNotFoundException etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs. low-priority Low priority to be addressed.
Development

No branches or pull requests

3 participants