0

I'm trying to see all my warnings, but I can not see this one:

[WARNING] warning: there was one unchecked warning; re-run with -unchecked for details
[WARNING] one warning found

Here you can see the solution with SBT, but I can't find the solution with Maven.

Edited I already tried this:

       <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>${scala.maven.plugin.version}</version>
            <configuration>
                <scalaVersion>${scala.version}</scalaVersion>
                <args>
                    <arg>-unchecked</arg>
                    <arg>-deprecation</arg>
                    <arg>-explaintypes</arg>
                </args>
            </configuration>
        </plugin>

and this:

mvn clean compile -X -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true

mvn clean compile -Xlint:uncheckeddoesn't work

org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'lint' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/pgallego/.m2/repository), scala-tools.org (http://scala-tools.org/repo-releases), central (https://repo.maven.apache.org/maven2)]

Do you know any solution?

  • Are you trying to compile Java or Scala? If you are trying to compile Scala, then why are you trying to pass those arguments to the `maven-compiler-plugin` instead of the `scala-maven-plugin`, what is `source` `1.8`, and why is it `-Xlint:unchecked` instead of just `-unchecked` / `-deprecation`? I think you should post a more complete `pom.xml`, the mistake doesn't seem to be in the snippet you extracted. – Andrey Tyukin Jul 01 '19 at 07:29
  • When I tried `mvn clean compile -unchecked` I found this error `Unable to parse command line options: Unrecognized option: -unchecked` – Pablo López Gallego Jul 01 '19 at 07:42

1 Answers1

0

I have several pom and in the father of the rest, I wrote:

        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>${scala.maven.plugin.version}</version>
            <configuration>
                <scalaVersion>${scala.version}</scalaVersion>
                <args>
                    <arg>-unchecked</arg>
                    <arg>-deprecation</arg>
                    <arg>-explaintypes</arg>
                </args>
            </configuration>
        </plugin>

in it, but the pom with the warning doesn't have -unchecked, I duplicated this code and the problem was solved.