Jump to content

What should I do if I want to put the 'apache-common-net' lib jar into my build jar?


Recommended Posts

Posted

I'm trying to use the FTPClient part of the 'apache-common-net.jar'

But I don't know how to extract this lib to my build mod.

Should I build the jar by MCP and shadow plugin?

But I don't know what to do.

I had been trouble by this for serveral days.

Posted (edited)

This is my build.gradlew

buildscript {
    repositories {
		jcenter()
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
		classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'
apply plugin: 'com.github.johnrengelman.shadow'

version = "1.0"
group= "me.mawmanager.mawpi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "MawModI"

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "eclipse"
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
	compile files(fileTree(dir: 'libs', includes: ['*.jar']))
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
	// https://mvnrepository.com/artifact/commons-net/commons-net
	compile group: 'commons-net', name: 'commons-net', version: '3.6'
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version
	//include(dependency('commons-net:commons-net:3.6'))
    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
         
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

PS:No file in the libs folder.

Edited by themaw
Something wrong
Posted

1.7.10 is no longer supported on this forum due to its age.

Please update to a modern version of Minecraft to receive support.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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