问题标签 [scala-maven-plugin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
maven - 未能执行目标 org.scalatest:scalatest-maven-plugin:2.0.0:test (test)
我正在尝试使用 Maven POM 构建我的 Scala 代码,并且我的 POM 中有以下插件:
当我尝试从 Scala IDE(全新安装)进行 Maven 构建时,我面临以下错误:
但是当检查我的本地 .m2 文件夹时,我可以在那里看到相关的 Jar、pom 和 sha1 文件:
如果有人遇到过类似的问题,你能帮我解决这个问题吗?谢谢
详细的错误日志:
scala - maven-shade-plugin 是否适用于 scala 类?
我有一个包含 Java 和 Scala 组件的 maven 项目,但是当我使用 maven-shade-plugin 时,它会重新定位 Java 和 Scala 文件的包名,但只会重命名 Java 文件中的包,Scala 文件仍然包含旧的包名,我错过了什么?
scala - 无法编译 scala&java 项目。找不到临时依赖项
我有一种强烈的感觉,我错过了一些东西。我正在尝试在我的工作中编译 Java&Scala 项目。幸运的是,我能够在一个简单的虚拟项目上拒绝我的问题。我正在使用 scala-maven-plugin(https://github.com/davidB/scala-maven-plugin)。我的例子也是基于这个问题
旨在解决Scala&Java多模块项目。我有 root 和两个模块 m1 和 m2。
m1 pom:
m2 pom:
根pom:
我的目标很简单,我希望 m1 项目从 m2 模块中获取所有 spark dpedencies,以便在 m1 模块中编译 spark 代码。
这是 m1 中的火花代码:
m2 编译工作顺利。在编译 m1 时,所有 java 编译过程都很好,但是在尝试编译 scala 代码时,它找不到 spark 依赖项,就好像它在依赖模块之间没有瞬态一样。
此外,如果我将所有 m2 spark 依赖项复制到 m1 pom 一切正常。
我似乎无法理解我做错了什么。我确信这是 scala - maven 问题,因为这种情况在 java 中非常简单。
添加编译错误:
scala - 如何修复警告:-c 已被弃用
我正在做mvn clean install
并收到此错误:
scala - Passing scalac opts to Maven from the command-line or environment
I'm looking for an unobtrusive way to make mvn
aware of additional flags I'd like to pass to the scalac
compiler via the command-line or environment variables only.
I'm currently using the scala-maven-plugin with a command such as:
In this case I want mvn
to treat the compile stage as if it had been passed flags such as:
I do not want to touch the project's pom.xml
. The reason for that in this case is that this is a step in an upstream CI/CD templates repository, so I don't have permission to mess with the Maven configuration of the downstream projects.
It does not appear that this is what MAVEN_OPTS
is made for, so I'm wondering if there is some alternative to talk to scalac
.
scala - 将 JVM 参数提供给命令行“mvn scala:run”
我正在尝试使用scala-maven-plugin
. 我可以执行
mvn scala:run -DmainClass=... -DaddArgs=...
但我也想将 JVM args 添加到命令行。看起来这可以通过 POM 中的启动配置来完成,但我想完全从命令行完成。有没有办法做到这一点?
scala - 为什么我得到“找不到编译器镜像中的对象 scala.runtime”。升级依赖项时使用 scala-maven-plugin?
我有一个使用 Scala 的基于 Maven 的项目。我尝试升级内部依赖项,现在我得到了
我正在挖掘子依赖差异,但有人知道为什么会发生这种情况吗?
附加信息
该错误非常模糊,因此我将尽我所能更新更多信息。
java - scala-maven-plugin 在提到时无法找到源目录
当我编译Scala源代码时,它pom.xml
可以工作:
但不是这个选择:
即使插件文档sourceDir
中testSourceDir
提到了这种用法。
我需要第二种选择,因为我在此执行之后调用了依赖于其他源文件目录的Java编译器。
我也尝试调用add-source
目标。没有成功。
java - 编译失败,JavaScanner.skipBlockComment 上由 scala-maven-plugin 驱动的 Java 1.8 (Scala 2.12.10 = Spark 2.4.6) 出现 StackOverflowError
我尝试用scala-maven-plugin 2.4.0
.
使用的父 pom 是以下一个,scala.version = 2.12,如果您检查其依赖关系,则具有依赖项org.scala-lang:scala-library:2.12.10
,来自Spark-core 2.4.6 。它依赖于另一个只知道如何编译Java源代码的 pom。
编译具有以下内容的项目时:三个Java源文件为
src/main/scala
空
src/main/java
它以这种方式失败:
八个项目中的三个项目遇到了这个问题。
为什么要
scala-maven-plugin
尝试编译src/main/java
内容?
我有没有提到我要求它编译Scala源代码src/main/scala
?这个错误可能是什么?
我的 javadoc 或注释在我的Java源文件中没有问题:所有Eclipse警告都检查了它们,以确保 Javadoc 的正确性。以这样的麻烦开始一个Scala / Java混合项目让我觉得Scala编译器无法为这样的工作做好准备。
它打算以这种方式使用吗?
对于其中一个项目,我找到了一个原因:
这个完全正确的评论:
对Scala编译器想要查看的外部文件的注释大小是否有限制,即使它们不关心?
它是哪一个?3行,最多4行?
另一方面,似乎(我不确定:我不想删除我的源文件上的评论来检查)这些评论因为太多而被拒绝:
当我开始编写Scala源文件时,我必须遵守哪些注释限制?
没有太多评论,我理解,因为Scala在限制之后无法处理它们,
但是有多少 low ?
我找到了避免错误的解决方法:
(就像您愿意指定您正在编译Java 1.8.151
而不是在编译Java 1.8
)。
scala - ScalaTest 错误对象 flatspec 不是包 org.scalatest 的成员
如 scalatest.org 上的参考文档中所述,我再次从 scalatest.org 站点和 maven 配置中使用了示例测试,但是每当我运行mvn clean install
它时,它都会引发 scala 测试的编译时错误。
分享pom.xml
以下内容
根据 scalatest.org 的 Scala 测试基础测试类
实际的 Scala 测试
运行时出错mvn clean install
有关基于其他类似文章探索的信息,也共享文件夹结构..