Unable to set classifier correctly for jar archives
See original GitHub issueVersion: 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:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a side note, the same
afterEvaluate
overuse leads to not being able to change other properties outside ofafterEvaluate
, likeremapAccessWidener
in Adorn. Even the archive classifier that I set above would be broken, but Loom (luckily for me?) uses the deprecatedsetClassifier
instead ofgetArchiveClassifier().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 inafterEvaluate
.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 bedev
unless you modify it, so if you really wantfabric-dev
, you also need to addjar { archiveClassifier.set("fabric-dev") }
.