Jump to content

Build a mod with jar dependency


Ardno

Recommended Posts

Hello,

I'm new in creating mods and using intellij idea. I saw a few tutorials about this topic, but if I use a dependency and build mod, the dependency doesn't want to compile into final jar.

 

My build.gradle:

dependencies {
    minecraft 'net.minecraftforge:forge:1.16.3-34.1.0'

    compile 'edu.cmu.sphinx:sphinx4-core:5prealpha-SNAPSHOT'
    compile 'edu.cmu.sphinx:sphinx4-data:5prealpha-SNAPSHOT'
}

 

And my build method:

image.png.67f5db361692900c472d2366be0f156c.png

 

But result is without compiled dependency. Where is a problem?

Thanks for replying.

Link to comment
Share on other sites

Libraries dont just automatically get built into the jar of each project that uses them.

That would be an immense waste of space/bandwidth.

Not to mention the potentially legalities of it. 

You wouldn't want to ship all of Minecraft in your Jar just because you use it as a dependency.

However if you DO want to shade a jar in, you can. There are tools such as the shadow plugin for gradle that'll let you choose which libraries to ship.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.