Skip to content

Gradle plugin to allow easy access to modrinth files

Notifications You must be signed in to change notification settings

vampire-studios/ModrinthMaven

 
 

Repository files navigation

ModrinthMaven

Gradle plugin to allow easy access to modrinth files for your project.

It is based on CurseMaven plugin.

Applying the plugin

Latest version:

First, add jitpack.io to your plugin repositories:

maven {
    name = 'Jitpack'
    url = 'https://jitpack.io'
}

Then add a resolution strategy to your plugin management:

resolutionStrategy {
    eachPlugin {
        if (requested.id.id == "io.github.vampirestudios.modrinthmaven" && requested.version?.endsWith("-SNAPSHOT") != true) {
            useModule("com.github.vampire-studios.ModrinthMaven:ModrinthMaven:${requested.version}")
        }
    }
}

Finally add this to your plugins:

plugins {
  id "io.github.vampirestudios.modrinthmaven" version "1.0.1"
}

Usage

Using the plugin is very simple. The dependency format is as follows:
modrinth.maven:<modpageid>:<fileid>

  • modrinth.maven -> Required. Marks the dependency to be resolved by the modrinth maven plugin.
  • <modpageid> -> the id of the mod on modrinth. e.g. : tyCNRhS8 which is the mod id of VampireLib on modrinth, you can find it in the mod page url https://modrinth.com/mod/tyCNRhS8/.
  • <fileid> -> the file id of the file you want to add as a dependency. Same you can also find it in the file page's url https://modrinth.com/mod/tyCNRhS8/version/UjMEn7wu.
dependencies {
  compile "modrinth.maven:tyCNRhS8:UjMEn7wu"
}

resolves the file here, with the scope compile

dependencies {
  include "modrinth.maven:aXf2OSFU:L7TmfftT"
}

resolves the file here, with the scope include

Special Thanks to

  • Wyn-Price for write the original plugin for curseforge
  • Tamaized for working with Wyn-Price to figure out the cloudflare/403 issues.

About

Gradle plugin to allow easy access to modrinth files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%