Maven警告:有一项未经检查的警告;重新运行-unchecked以获取详细信息

时间:2019-07-01 06:15:17

标签: scala maven

我正在尝试查看所有警告,但看不到此警告:

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

Here,您可以看到使用SBT的解决方案,但是我找不到使用Maven的解决方案。

已编辑,我已经尝试过:

       <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>

这:

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

mvn clean compile -Xlint:unchecked不起作用

  

org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException:在当前项目和插件组[org.apache.maven.plugins,org.codehaus.mojo]中找不到前缀“ lint”的插件。存储库[本地(/home/pgallego/.m2/repository)、scala-tools.org(http://scala-tools.org/repo-releases),中央(https://repo.maven.apache.org/maven2)]

您知道任何解决方案吗?

1 个答案:

答案 0 :(得分:0)

我有几个pom,在其余的父亲中,我写道:

        <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>

其中,但是带有警告的pom没有-unchecked,我复制了这段代码,问题得以解决。