CurseForge Maven Dependency Skill
Add a CurseForge mod (by URL) as a Maven dependency using the CurseForge Maven endpoint.
Inputs
- CurseForge mod URL (required)
- Latest file name (optional but often required): the newest release .jar filename from the project’s Files list
Requirements
- Environment variables:
CURSE_USER= your CurseForge account emailCURSE_TOKEN= your CurseForge API token
- Maven repository:
https://www.curseforge.com/api/maven/
Note: CurseForge’s docs indicate Maven auth is embedded in the URL, but in practice some endpoints require API token auth. This skill uses
CURSE_USER/CURSE_TOKENvia Maven server credentials and can fall back to a?token=query parameter if needed.
Project Setup (Maven)
- Ensure the CurseForge repository exists in pom.xml:
id:curseforgeurl:https://www.curseforge.com/api/maven/
- Ensure Maven uses credentials via .mvn/settings.xml:
username:${env.CURSE_USER}password:${env.CURSE_TOKEN}
- If you still receive 401 errors, update the repository URL to include the token:
https://www.curseforge.com/api/maven/?token=${env.CURSE_TOKEN}
How to Derive Maven Coordinates (Latest Release)
Given a mod URL like:
https://www.curseforge.com/hytale/mods/<projectSlug>
- projectSlug = last path segment (example:
my-mod). - Get the latest release filename from the mod’s Files list, e.g.
MyMod-1.2.3-release-universal.jar
- Parse the filename:
mavenArtifact=MyMod-1.2.3mavenVersion=releaseprojectFileNameTag(classifier) =universal
Maven dependency format:
<dependency>
<groupId>projectSlug</groupId>
<artifactId>mavenArtifact</artifactId>
<version>release</version>
<classifier>projectFileNameTag</classifier>
</dependency>
Scripted Add (Recommended)
Use the PowerShell script in:
- .github/skills/curseforge-maven/scripts/add-curseforge-mod.ps1
It will:
- Extract the slug from the URL
- Ask for (or parse) the latest file name
- Add the dependency and repository to the Maven
pom.xml
Edge Cases
- If the filename doesn’t include a tag (e.g., no
-universal), omit the classifier. - If
releasedoesn’t resolve, use the actual file version from the name instead (e.g.,1.2.3). - If the mod is not a
.jar, Maven dependency may not work.