File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,26 @@ dependencies {
102102tasks. withType(JavaCompile ). configureEach {
103103 options. compilerArgs. add(" -parameters" )
104104}
105+
106+ // Configure the jar task to include test classes and resources
107+ tasks. named(' jar' ) {
108+ from sourceSets. test. output
109+
110+ // Include the test resources
111+ from(sourceSets. test. resources) {
112+ // Handle duplicate files by using the first one found
113+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
114+ }
115+
116+ // Include the manifest with the classpath
117+ manifest {
118+ attributes(
119+ ' Implementation-Title' : project. name,
120+ ' Implementation-Version' : project. version,
121+ ' Built-By' : System . getProperty(' user.name' ),
122+ ' Built-Date' : new Date (),
123+ ' Created-By' : ' Gradle ' + gradle. gradleVersion,
124+ ' Build-Jdk' : System . getProperty(' java.version' )
125+ )
126+ }
127+ }
You can’t perform that action at this time.
0 commit comments