Skip to content

Commit 95fe79d

Browse files
authored
Add artifact only if downloads.artifact is not null, fixes mojang versions that don't list main artifact. (#770)
1 parent 059c452 commit 95fe79d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/common/java/net/minecraftforge/gradle/common/util/MinecraftRepo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ protected File findPom(String side, String version, File json) throws IOExceptio
217217
VersionJson meta = Utils.loadJson(json, VersionJson.class);
218218
for (VersionJson.Library lib : meta.libraries) {
219219
if (lib.isAllowed()) {
220-
builder.dependencies().add(lib.name, "compile");
220+
if (lib.downloads.artifact != null)
221+
builder.dependencies().add(lib.name, "compile");
221222
if (lib.downloads.classifiers != null) {
222223
if (lib.downloads.classifiers.containsKey("test")) {
223224
builder.dependencies().add(lib.name, "test").withClassifier("test");

src/mcp/java/net/minecraftforge/gradle/mcp/MCPRepo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ private File findPom(String side, String version) throws IOException {
255255
VersionJson meta = Utils.loadJson(json, VersionJson.class);
256256
for (VersionJson.Library lib : meta.libraries) {
257257
if (lib.isAllowed()) {
258-
builder.dependencies().add(lib.name, "compile");
258+
if (lib.downloads.artifact != null)
259+
builder.dependencies().add(lib.name, "compile");
259260
if (lib.downloads.classifiers != null) {
260261
if (lib.downloads.classifiers.containsKey("test")) {
261262
builder.dependencies().add(lib.name, "test").withClassifier("test");

0 commit comments

Comments
 (0)