带有scala的春季启动在Maven Intelliji中不自动编译
我有一个带有 scala 的 spring boot 项目(我使用 java+scala 混合)。
intellij 的一些屏幕:
pom.xml 中一些有趣的部分
<scala.version>3.1.1</scala.version>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala3-library_3</artifactId>
<version>${scala.version}</version>
</dependency>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.6.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
不知道为什么,但是当我在 scala 文件中进行一些更改时,我需要单击“构建项目”按钮,看看是否有一些错误,对于 java 文件来说一切正常美好的。
I have spring boot project with scala inside ( I use java+scala mixed ).
Some screens from intellij:
Some interesting parts in pom.xml
<scala.version>3.1.1</scala.version>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala3-library_3</artifactId>
<version>${scala.version}</version>
</dependency>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.6.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
Not sure why, but when I do some change in scala file, I need to click Build Project button, to see if there are some errors, for java files all works fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我发现..
在项目设置中,SDK在Project和SDK下的SDK无效
更改为:
现在一切正常
ok I found..
in project settings had invalid SDK under Project and SDKs
changed both to:
now everything works fine