Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normal jar and fat jar #755

Closed
soloturn opened this issue Feb 13, 2022 · 1 comment
Closed

normal jar and fat jar #755

soloturn opened this issue Feb 13, 2022 · 1 comment

Comments

@soloturn
Copy link

soloturn commented Feb 13, 2022

Shadow Version

7.1.2

Gradle Version

7.4

Expected Behavior

build a normal plantuml.ar and one plantuml-all-jar, no other change. i did include only one line and it makes all jars change:

	id("com.github.johnrengelman.shadow") version "7.1.2"

Actual Behavior

both are fat jars, optional dependencies included.

Gradle Build Script(s)

java {
	withSourcesJar()
	withJavadocJar()
	registerFeature("pdf") {
		usingSourceSet(sourceSets["main"])
	}
}

dependencies {
	compileOnly("org.apache.ant:ant:1.10.12")
	testImplementation("org.assertj:assertj-core:3.22.0")
	testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
	testImplementation("org.scilab.forge:jlatexmath:1.0.7")
	"pdfRuntimeOnly"("org.apache.xmlgraphics:fop:2.6")
	"pdfRuntimeOnly"("org.apache.xmlgraphics:batik-all:1.14")
}

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

pdfRuntimeOnly jars are included in both jar files, also source and javadoc grow, the buildgradle.kts, compare with maven, original gradle jars were the same as maven. now all are grown:

> ls -l target/*.jar build/libs/*.jar
24999965 13. Feb 11:22 build/libs/plantuml-1.2022.1-SNAPSHOT-all.jar
24999955 13. Feb 09:57 build/libs/plantuml-1.2022.2.jar
31333430 13. Feb 09:58 build/libs/plantuml-1.2022.2-javadoc.jar
23742790 13. Feb 09:58 build/libs/plantuml-1.2022.2-sources.jar
 9973551 13. Feb 08:45 target/plantuml-1.2022.1-SNAPSHOT.jar
15492349 13. Feb 08:45 target/plantuml-1.2022.1-SNAPSHOT-javadoc.jar
 8716781 13. Feb 08:45 target/plantuml-1.2022.1-SNAPSHOT-sources.jar
@soloturn
Copy link
Author

soloturn commented Feb 13, 2022

having an empty shadow task or set properties produces the original jar.

tasks.shadowJar {
	archiveAppendix.set("myappendix")
	archiveClassifier.set("")
}

setting the classifier empty leads to #651 though ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant