Spring boot with scala in maven intelliji not auto compiling

374 Views Asked by At

I have spring boot project with scala inside ( I use java+scala mixed ).

Some screens from intellij:

enter image description here enter image description here

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.

1

There are 1 best solutions below

0
On

ok I found.. in project settings had invalid SDK under Project and SDKs changed both to:

enter image description here

now everything works fine