shapeless.DefaultSymbolicLabelling shapeless.DefaultSymbolicLabelling$.instance(shapeless.HList)
同時使用 pureconfig 和 circe 時出現此錯誤。我將 spark 3.1.2 與 spark k8s 運算子一起使用。
uj5u.com熱心網友回復:
此錯誤是因為無形庫版本沖突。Spark 3.1.2 附帶 shapeless 2.3.3,而這兩個包都需要 shapeless 2.3.7。為了解決這個問題,我遵循了這里提到的步驟,這些步驟涉及著色,即重命名依賴項。
對于 SBT
如果您使用 sbt-assembly 插件來創建您的 JAR,您可以通過在您的 assembly.sbt 檔案中添加以下設定來著色無形:
assembly / assemblyShadeRules := Seq(ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll)
馬文
maven-shade-plugin可以通過將以下塊添加到您的 pom.xml 檔案中來著色無形:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>shapeless</pattern>
<shadedPattern>shapelesspureconfig</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/459746.html
