您如何在Maven2中使用maven-simian-plugin? [英] How do you use the maven-simian-plugin in Maven2?

查看:92
本文介绍了您如何在Maven2中使用maven-simian-plugin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找 Simian 的Maven2报告插件,我发现此类报告的内容是 .问题是,文档似乎是针对Maven的.改为1.为什么将Maven 1插件存储在Maven 2存储库中?我想那意味着我可以使用它...但是如何使用呢?该网站提到报告,但是如果我没有src/main/site,是否表示我无法使用它?我有点希望类似mvn checkstyle:checkstylemvn pmd:pmdmvn simian:simian之类的东西.我不想只为报告生成网站.当我想要的是一个相当不错的xml报告时,生成网站所需的时间太长.

I'm looking for a Maven2 reporting plugin for Simian and the closest thing to such a reporting I found is this. The problem is, the documentation for it appears to be for Maven 1 instead. Why is a Maven 1 plugin stored in a Maven 2 repository? I suppose that means I can use it... but how to use? The site mentions reporting but if I don't have a src/main/site, does that mean I can't use it? I was kinda hoping for something like mvn simian:simian similar to mvn checkstyle:checkstyle and mvn pmd:pmd. I don't want to generate site just for the reports. Sites take too long to generate when all I want is a quite xml report.

推荐答案

中央列出的Simian插件实际上适用于Maven 1(如果您检查内容,则会看到project.xml和plugin.jelly).这就解释了为什么它不起作用.这是垃圾,我认为应该清除.

The Simian plugin listed on central is actually for Maven 1 (if you inspect the contents you'll see a project.xml and a plugin.jelly). So that explains why it doesn't work. This is rubbish and should be removed in my opinion.

据我所知,没有一个公开可用的Maven 2插件,这可能与许可证有关(Simian

As far as I can make out there isn't a publically available Maven 2 plugin, this may have something to do with the licence (Simian isn't open source).

或者,请查看PMD的 CPD插件,它可能不是全功能为simian,但我知道它可以在Maven 2版本中使用,并且可以很好地检测到copypasta.

As an alternative, have a look at PMD's CPD plugin, it may not be as fully featured as simian but I know it works in a Maven 2 build and detects copypasta pretty well.

要配置PMD,请在您的POM中添加以下内容:

To configure PMD, add something like the following to your POM:

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-pmd-plugin</artifactId>
      <version>2.4</version>
    </plugin>
  </plugins>
</reporting>

这篇关于您如何在Maven2中使用maven-simian-plugin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆