question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to set classifier correctly for jar archives

See original GitHub issue

Version: 0.8.21

No effect (ideally this is the approach that should work as expected):

tasks.jar {
	archiveClassifier.set("foo")
}

Produces a JAR with the correct classifier, but -dev jar with no prepended classifier:

afterEvaluate {
	tasks.remapJar {
		archiveClassifier.set("foo")
	}
}
Example-1.0.0-dev.jar
Example-1.0.0-foo.jar

Produces an error:

afterEvaluate {
	tasks.jar {
		archiveClassifier.set("foo")
	}
}

OR 

afterEvaluate {
	tasks.jar {
		archiveClassifier.set("foo")
	}

	tasks.remapJar {
		archiveClassifier.set("foo")
	}
}
A problem was found with the configuration of task ':remapJar' (type 'RemapJarTask').
  - In plugin 'net.fabricmc.loom.LoomRepositoryPlugin' type 'net.fabricmc.loom.task.RemapJarTask' property 'input' specifies file '...\build\libs\Example-1.0.0-dev.jar' which doesn't exist.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Juuxelcommented, Jul 27, 2021

As a side note, the same afterEvaluate overuse leads to not being able to change other properties outside of afterEvaluate, like remapAccessWidener in Adorn. Even the archive classifier that I set above would be broken, but Loom (luckily for me?) uses the deprecated setClassifier instead of getArchiveClassifier().set() so it’s only used as a fallback.

Really, all of this code needs to be changed to a) use Property instead of deprecated archive task methods, and b) not be in afterEvaluate.

1reaction
Juuxelcommented, Dec 11, 2021

Loom doesn’t base the classifier edits for the default jars on the current remapJar classifier. (The classifier for named jars doesn’t really matter considering they’re not all that useful)

Loom just sets the jar task’s classifier to be dev unless you modify it, so if you really want fabric-dev, you also need to add jar { archiveClassifier.set("fabric-dev") }.

Read more comments on GitHub >

github_iconTop Results From Across the Web

maven how to install a jar with a classifier and not install the ...
I can build either using build targets ( install for regular, spring-boot:repackage to create runnable jar). How to deploy each one? Creating an ......
Read more >
IDE: Unresolved reference from fat jar dependency (with Kotlin ...
I've been tried to build a fat jar for a Kotlin project and have found that the classes aren't visible to projects including...
Read more >
Adding Classes to the JAR File's Classpath
We want to load classes in MyUtils.jar into the class path for use in MyJar.jar. These two JAR files are in the same...
Read more >
Apache Maven JAR Plugin
The archive configuration to use. See Maven Archiver Reference. <classifier>, String, -, Classifier to add to the artifact generated.
Read more >
Troubleshooting errors in AWS Glue
If AWS Glue fails to successfully provision a development endpoint, it might be because of a problem in the network setup. When you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found