Repository: GradleUp/shadow (kotlin)

Issue:
9.0.0-beta9 - adding jar dependency using `from` doesn't extract jar content
### Expected and Results

I have a custom `ShadowJar` task and I'm using `from()` method to add additional jar files. Up to `beta8` the added jar files were extracted and that's what I need. But with beta9 they are not - they are just added as `*.jar` files to my shadow jar.
I have found some inconsistent comments about the `from` method usage. According to this:
https://github.com/GradleUp/shadow/blob/main/src/docs/configuration/README.md#adding-extra-files
the content should be extracted. But according to this PR https://github.com/GradleUp/shadow/pull/1250 it should not. So I'm not sure if the change was intentional? If the answer is yes, how can I achieve the old behaviour?

### Related environent and versions

_No response_

### Reproduction steps

_No response_

### Anything else?

_No response_

Pull request description:
Closes #1284.

Patch:
diff --git a/src/docs/configuration/README.md b/src/docs/configuration/README.md
index 950514c68..41c2d0db0 100644
--- a/src/docs/configuration/README.md
+++ b/src/docs/configuration/README.md
@@ -109,8 +109,12 @@ method can be used to add extra files.
 ```groovy
 tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
   from('extra.jar') {
-    // Copy the contents of the extra.jar file into META-INF/ in the shadowed JAR.
+    // Copy extra.jar file (without unzipping) into META-INF/ in the shadowed JAR.
     into('META-INF')
   }
+  from('Foo') {
+    // Copy Foo file into Bar/ in the shadowed JAR.
+    into('Bar')
+  }
 }
 ```


Test patch:
diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
index 4d4521bee..832ee671b 100644
--- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
+++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
@@ -20,6 +20,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
 import com.github.jengelman.gradle.plugins.shadow.util.Issue
 import com.github.jengelman.gradle.plugins.shadow.util.containsEntries
 import com.github.jengelman.gradle.plugins.shadow.util.doesNotContainEntries
+import com.github.jengelman.gradle.plugins.shadow.util.getContent
 import com.github.jengelman.gradle.plugins.shadow.util.getMainAttr
 import com.github.jengelman.gradle.plugins.shadow.util.getStream
 import com.github.jengelman.gradle.plugins.shadow.util.runProcess
@@ -659,12 +660,16 @@ class JavaPluginTest : BasePluginTest() {
   @Test
   fun canAddExtraFilesIntoShadowJar() {
     writeMainClass()
+    path("Foo").writeText("Foo")
     projectScriptPath.appendText(
       """
         $shadowJar {
           from(files('${artifactAJar.toUri().toURL().path}')) {
             into('META-INF')
           }
+          from('Foo') {
+            into('Bar')
+          }
         }
       """.trimIndent(),
     )
@@ -675,8 +680,10 @@ class JavaPluginTest : BasePluginTest() {
       containsEntries(
         "my/Main.class",
         "META-INF/a-1.0.jar",
+        "Bar/Foo",
       )
       doesNotContainEntries(*entriesInA)
+      getContent("Bar/Foo").isEqualTo("Foo")
     }
     val unzipped = path("unzipped")
     outputShadowJar.use {