【问题标题】:IntelliJ 'maven-site-plugin' reportPlugins showing error, haven't even done anything yetIntelliJ 'maven-site-plugin' reportPlugins 显示错误,甚至还没有做任何事情
【发布时间】:2017-01-22 05:00:00
【问题描述】:

我是 IntelliJMaven 的新手,所以这一切都超出了我的想象

我正在关注DropWizard 教程here,我只完成了IntelliJ 的第一步,我在其中添加了具有以下值的Maven 原型

GroupId=io.dropwizard.archetypes

ArtifactId=java-simple

版本= 0.9.1

没关系,然后我继续生成新项目,立即pom.xml 文件中,maven-site-pluginplugin 节点出现错误。

   <plugin>
     <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                    <configuration>
                        <reportPlugins>
                            <plugin>
                                <artifactId>maven-project-info-reports-plugin</artifactId>
                                <version>2.4</version>
                                <configuration>
                                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                                </configuration>
                            </plugin>
                            <plugin>
                                <artifactId>maven-javadoc-plugin</artifactId>
                                <version>2.10.3</version>
                            </plugin>
                        </reportPlugins>
  </configuration>
            </plugin>

上面写着“Element reportPlugins is not allowed here”,reportPlugins 中的所有内容都会出现“Cannot resolve symbol”错误。

我不知道发生了什么。甚至不知道谷歌用什么关键词来解决这个问题,所以在互联网上找不到相关的东西。有人介意告诉我这里有什么吗?我没有使用正确的版本吗?这是 IntelliJ 的怪癖吗?

【问题讨论】:

    标签: intellij-idea pom.xml maven-site-plugin


    【解决方案1】:

    我相信reportsPlugin 是一个实验性功能,文档说不要使用它。虽然我已经看到它在互联网上的许多地方被使用。它会在 IntelliJ 内部报错,但如果您从控制台运行 maven,它将构建并执行站点目标。

    您应该从&lt;reportsPlugin&gt; 中取出这些插件并将它们放入&lt;reporting&gt; 元素中。这适用于 Maven v3.3.9 和 IntelliJ v2016.3。 Maven 没有抱怨,IntelliJ 也很高兴。

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
        </plugin>
      </plugins>
    </build>
    
    <reporting>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.9</version>
        </plugin>
      </plugins>
    </reporting>
    

    【讨论】:

      猜你喜欢
      • 2017-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-09
      • 1970-01-01
      • 1970-01-01
      • 2020-08-10
      • 1970-01-01
      相关资源
      最近更新 更多