Compiler options when importing a Maven project

Hi,

I have a Maven project with the following Scala compiler configuration:

      <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <charset>UTF-8</charset>
                    <jvmArgs>
                        <jvmArg>-Xmx1024m</jvmArg>
                    </jvmArgs>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <args>
                                <arg>-deprecation</arg>
                                <arg>-unchecked</arg>
                                <arg>-optimise</arg>
                                <arg>-feature</arg>
                            </args>
                            <recompileMode>modified-only</recompileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

When I imported the Maven project into IntelliJ I went into Project Structure -> Modules -> <my project> -> Scala and all of the compiler option checkboxes were unchecked. I checked the appropriate ones and added "-feature" in "Additional compiler options". However, I have set the project to autoimport every time the POM changes, and every time that happens the compiler options get unchecked. Is there a way of setting up the POM file so the compiler options are actually imported? Or perhaps so that the dependencies are imported but the compiler options are not reset?

Thanks!

1 comment

The Scala plugin considered only plugin/configuration elements during project import. That is now fixed.

You can either move <args> element into the plugin/configuration element, or wait for the next plugin nightly build.

Thank you for the report!

0

Please sign in to leave a comment.