【问题标题】:cannot import cobertura-maven-plugin in intelliji无法在 intellij 中导入 cobertura-maven-plugin
【发布时间】:2021-01-03 21:25:48
【问题描述】:

我使用 Intelliji IDEA 2019.3,并尝试以这种方式使用 cobertura-maven-plugin

       <reporting>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${cobertura.version}</version>
                    <configuration>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <targetJdk>1.6</targetJdk>
                        <aggregate>true</aggregate>
                        <format>xml</format>
                        <rulesets>
                            <ruleset>/pmd-rules.xml</ruleset>
                        </rulesets>
                        <!-- CPD options -->
                        <minimumTokens>20</minimumTokens>
                        <ignoreIdentifiers>true</ignoreIdentifiers>

                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <configLocation>gameoflife-build/checkstyle.xml</configLocation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>2.4.0</version>
                    <configuration>
                        <effort>Max</effort>
                        <xmlOutput>true</xmlOutput>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.7</version>
                    <configuration>
                        <source>1.6</source>
                        <doclet>
                            gr.spinellis.umlgraph.doclet.UmlGraphDoc
                        </doclet>
                        <docletArtifact>
                            <groupId>gr.spinellis</groupId>
                            <artifactId>UmlGraph</artifactId>
                            <version>4.6</version>
                        </docletArtifact>
                        <additionalparam>
                            -inferrel -inferdep -hide java.* -collpackages
                            java.util.* -attributes -operations
                            -enumerations -enumconstants
                        </additionalparam>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>2.1</version>
                </plugin>
            </plugins>
        </reporting>

但是 Intelliji 没有找到 maven 插件 cobertura-maven-plugin,报告部分的其他插件也没有

Lorem ipsum dolor sit amet,consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat。 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。 Exceptioneur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

【问题讨论】:

  • 首先请用英文写...否则很难理解您想问什么?其次,您使用的是非常旧的软件(IDEA 2019?...当前 2020.3.1..)此外,But Intelliji does not find the maven plugin ... 是什么意思?是否在普通命令行上构建?
  • 对不起,我放了一些拉丁文,因为代码太多。此外,我的意思是 Maven 3.6.1 捆绑在我的 intelliji 版本中,并且 maven 没有找到这个 maven 插件。第三,是的,它可以在普通命令行上运行
  • 对简单的命令我有疑问。你打电话给mvn site 进一步升级你的环境......这是什么意思...... Maven 没有找到这个 Maven 插件?下载错误 ?请出示一下?请编辑帖子....

标签: maven intellij-idea plugins


【解决方案1】:

要让 IDE 能够解析插件 - 它必须位于本地 Maven 存储库中。那里有吗?

为确保指定版本的插件已下载到本地 Maven 存储库 - 您可以执行此插件的任何 maven 目标。然后 Maven 会将其从远程 Maven 存储库下载到本地 Maven 存储库中,IDE 将能够解析它。

【讨论】:

  • 您好 Andrew,谢谢您,我在 CLI 中运行 mvn install 并成功将其下载到本地存储库中,但在 intelliji 中,我收到以下错误消息: Plugin 'org.codehaus.mojo:cobertura -maven-plugin:2.6' 未找到
  • 对不起,我没有放正确的版本。我下载了2.7版本。解决了。再次感谢
猜你喜欢
  • 1970-01-01
  • 2012-01-07
  • 1970-01-01
  • 2015-06-18
  • 2021-02-20
  • 1970-01-01
  • 2016-07-28
  • 2012-08-31
  • 1970-01-01
相关资源
最近更新 更多