任务 "assembly" 失败并显示“[错误](程序集)java.nio.file.InvalidPathException:索引 121 处的尾随字符 < >”
Task "assembly" fails with "[error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 121"
执行任务 "assembly" 失败 [error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 121: C:\Users\IdeaProjects\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
。
build.sbt
name := "GlobalConfigEditor"
version := "0.3"
scalaVersion := "2.13.1"
mainClass in assembly := Some("globalconfig.ConfigEditorApplication")
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs@_*) => MergeStrategy.discard
case PathList("reference.conf") => MergeStrategy.concat
case x => MergeStrategy.first
}
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.9"
libraryDependencies += "commons-io" % "commons-io" % "2.6"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "com.typesafe.scala-logging" % "scala-logging_2.13" % "3.9.2"
libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.3"
libraryDependencies += "org.fxmisc.richtext" % "richtextfx" % "0.10.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.1" % "test"
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test
libraryDependencies += "org.mockito" % "mockito-scala_2.13" % "1.11.3"
libraryDependencies += "org.mockito" % "mockito-scala-scalatest_2.13" % "1.11.3"
plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
build.properties
sbt.version=1.3.8
堆栈跟踪
[error] java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[error] at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:172)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[error] at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[error] at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[error] at java.io.File.toPath(File.java:2234)
[error] at sbt.io.IO$.createDirectory(IO.scala:330)
[error] at sbt.io.IO$.archive(IO.scala:643)
[error] at sbt.io.IO$.jar(IO.scala:619)
[error] at sbt.Package$.makeJar(Package.scala:164)
[error] at sbtassembly.Assembly$.makeJar(Assembly.scala:40)
[error] at sbtassembly.Assembly$.$anonfun$apply(Assembly.scala:81)
[error] at sbtassembly.Assembly$.$anonfun$apply$adapted(Assembly.scala:77)
[error] at sbt.util.Tracked$.$anonfun$outputChanged(Tracked.scala:102)
[error] at sbtassembly.Assembly$.apply(Assembly.scala:85)
[error] at sbtassembly.Assembly$.$anonfun$assemblyTask(Assembly.scala:244)
[error] at scala.Function1.$anonfun$compose(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[IJ]sbt:GlobalConfigEditor>
谁能帮我解决这个问题?
免责声明:这是 this issue on github 的交叉 post。
这个:
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
没有如你所愿。 version
是一个设置。当你想访问它的值时,你需要这样做:
assemblyJarName in assembly := s"GlobalConfigEditor-${version.value}.jar"
执行任务 "assembly" 失败 [error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 121: C:\Users\IdeaProjects\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
。
build.sbt
name := "GlobalConfigEditor"
version := "0.3"
scalaVersion := "2.13.1"
mainClass in assembly := Some("globalconfig.ConfigEditorApplication")
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs@_*) => MergeStrategy.discard
case PathList("reference.conf") => MergeStrategy.concat
case x => MergeStrategy.first
}
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.9"
libraryDependencies += "commons-io" % "commons-io" % "2.6"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "com.typesafe.scala-logging" % "scala-logging_2.13" % "3.9.2"
libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.3"
libraryDependencies += "org.fxmisc.richtext" % "richtextfx" % "0.10.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.1" % "test"
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test
libraryDependencies += "org.mockito" % "mockito-scala_2.13" % "1.11.3"
libraryDependencies += "org.mockito" % "mockito-scala-scalatest_2.13" % "1.11.3"
plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
build.properties
sbt.version=1.3.8
堆栈跟踪
[error] java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[error] at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:172)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[error] at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[error] at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[error] at java.io.File.toPath(File.java:2234)
[error] at sbt.io.IO$.createDirectory(IO.scala:330)
[error] at sbt.io.IO$.archive(IO.scala:643)
[error] at sbt.io.IO$.jar(IO.scala:619)
[error] at sbt.Package$.makeJar(Package.scala:164)
[error] at sbtassembly.Assembly$.makeJar(Assembly.scala:40)
[error] at sbtassembly.Assembly$.$anonfun$apply(Assembly.scala:81)
[error] at sbtassembly.Assembly$.$anonfun$apply$adapted(Assembly.scala:77)
[error] at sbt.util.Tracked$.$anonfun$outputChanged(Tracked.scala:102)
[error] at sbtassembly.Assembly$.apply(Assembly.scala:85)
[error] at sbtassembly.Assembly$.$anonfun$assemblyTask(Assembly.scala:244)
[error] at scala.Function1.$anonfun$compose(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[IJ]sbt:GlobalConfigEditor>
谁能帮我解决这个问题?
免责声明:这是 this issue on github 的交叉 post。
这个:
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
没有如你所愿。 version
是一个设置。当你想访问它的值时,你需要这样做:
assemblyJarName in assembly := s"GlobalConfigEditor-${version.value}.jar"