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

IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:C:\... #472

Open
nightscape opened this issue Jun 23, 2022 · 1 comment

Comments

@nightscape
Copy link

nightscape commented Jun 23, 2022

On Windows, version 2.0.0-RC1 fails to properly do an assembly due to the following error, probably caused by the : in the file name:

Error: [error] java.lang.IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:C:\Users\runneradmin\AppData\Local\Temp\sbt_42829fa2\config\target\scala-2.12\foo.jar
Error: [error] 	at java.base/java.net.URI.create(URI.java:883)
Error: [error] 	at sbtassembly.Assembly$.createJar(Assembly.scala:533)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemble$45(Assembly.scala:348)
Error: [error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
Error: [error] 	at sbtassembly.Assembly$.timed$1(Assembly.scala:225)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemble$35(Assembly.scala:346)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$cachedAssembly$2(Assembly.scala:520)
Error: [error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
Error: [error] 	at sbtassembly.Assembly$.cachedAssembly(Assembly.scala:524)
Error: [error] 	at sbtassembly.Assembly$.assemble(Assembly.scala:411)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:193)
Error: [error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
Error: [error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
Error: [error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
Error: [error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
Error: [error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
Error: [error] 	at sbt.Execute.work(Execute.scala:278)
Error: [error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
Error: [error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
Error: [error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
Error: [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Error: [error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
Error: [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Error: [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Error: [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Error: [error] 	at java.base/java.lang.Thread.run(Thread.java:829)
Error: [error] Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 11: jar:file:C:\Users\runneradmin\AppData\Local\Temp\sbt_42829fa2\config\target\scala-2.12\foo.jar
Error: [error] 	at java.base/java.net.URI$Parser.fail(URI.java:2913)
Error: [error] 	at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
Error: [error] 	at java.base/java.net.URI$Parser.parse(URI.java:3120)
Error: [error] 	at java.base/java.net.URI.<init>(URI.java:600)
Error: [error] 	at java.base/java.net.URI.create(URI.java:881)
Error: [error] 	at sbtassembly.Assembly$.createJar(Assembly.scala:533)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemble$45(Assembly.scala:348)
Error: [error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
Error: [error] 	at sbtassembly.Assembly$.timed$1(Assembly.scala:225)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemble$35(Assembly.scala:346)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$cachedAssembly$2(Assembly.scala:520)
Error: [error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
Error: [error] 	at sbtassembly.Assembly$.cachedAssembly(Assembly.scala:524)
Error: [error] 	at sbtassembly.Assembly$.assemble(Assembly.scala:411)
Error: [error] 	at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:193)
Error: [error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
Error: [error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
Error: [error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
Error: [error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
Error: [error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
Error: [error] 	at sbt.Execute.work(Execute.scala:278)
Error: [error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
Error: [error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
Error: [error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
Error: [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Error: [error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
Error: [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Error: [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Error: [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Error: [error] 	at java.base/java.lang.Thread.run(Thread.java:829)
Error: [error] (Test / assembly) java.lang.IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:C:\Users\runneradmin\AppData\Local\Temp\sbt_42829fa2\config\target\scala-2.12\foo.jar

Version 1.2.0 works without issues.
The Windows CI runs from #471 properly reproduce this error, e.g. here.

@nightscape
Copy link
Author

The line causing the error is

jarFileSystemResource(URI.create(s"jar:file:${output.toPath.toString}")) { jarFS =>

A similar error in scala/jardiff was fixed by replacing

val uri = URI.create("jar:file:" + fileOrZip.toUri.getPath)

by

val uri = URI.create(s"jar:${fileOrZip.toUri}")

eed3si9n added a commit that referenced this issue Oct 5, 2022
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