How do you use the maven-simian-plugin in Maven2?

喜你入骨 提交于 2019-12-23 19:20:46

问题


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.


回答1:


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.

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

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.

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>


来源:https://stackoverflow.com/questions/1077700/how-do-you-use-the-maven-simian-plugin-in-maven2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!