Задача «сборка» завершается с ошибкой «[ошибка] (сборка) java .nio.file.InvalidPathException: конечный символ <> в индексе 121» - PullRequest
0 голосов
/ 30 марта 2020

Выполнение задачи «Сборка» завершается неудачно с [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$1(Assembly.scala:40)
[error]         at sbtassembly.Assembly$.$anonfun$apply$13(Assembly.scala:81)
[error]         at sbtassembly.Assembly$.$anonfun$apply$13$adapted(Assembly.scala:77)
[error]         at sbt.util.Tracked$.$anonfun$outputChanged$1(Tracked.scala:102)
[error]         at sbtassembly.Assembly$.apply(Assembly.scala:85)
[error]         at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:244)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(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$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.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>

Может кто-нибудь помочь мне с этим?

Отказ от ответственности: это кросс-пост этой проблемы на github .

1 Ответ

1 голос
/ 30 марта 2020

Это:

assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"

не делает то, что вы хотите. version - это настройка. Когда вы хотите получить доступ к его значению, вам нужно сделать следующее:

assemblyJarName in assembly := s"GlobalConfigEditor-${version.value}.jar"
...