分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!
https://blog.csdn.net/jiangjunshow
maven-site-plugin是一个负责为Java项目生成静态HTML网站的插件。这个插件非常的有用,里面可以嵌入各种插件,比如用来对代码检查bug的findbugs,检查代码风格的checkstyle,生成testng测试报告的surefire等。先来看一下关于这个插件的配置的一个例子:
<properties> <appengine.version>0.0.1-SNAPSHOT</appengine.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <testng_version>6.4</testng_version> <logback_version>1.0.3</logback_version> <maven_java_version>1.6</maven_java_version> <maven.site.version>3.0</maven.site.version> <maven_javadoc_version>2.8.1</maven_javadoc_version> <maven_surefire_report_version>2.12</maven_surefire_report_version> <maven_cobertura_version>2.5.1</maven_cobertura_version> <maven.checkstyle.version>2.9.1</maven.checkstyle.version> <maven_findbugs_version>2.4.0</maven_findbugs_version> <maven_pmd_version>2.7</maven_pmd_version> <maven_umlgraph_version>4.6</maven_umlgraph_version> <checkstyle_javaheader_file>java_copyright_header.txt</checkstyle_javaheader_file> <maven.jxr.version>2.3</maven.jxr.version> <project.info.reports.version>2.4</project.info.reports.version> </properties> <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>${testng_version}</version> <scope>test</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback_version}</version> </dependency> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>${maven.site.version}</version> <configuration> <reportPlugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>${project.info.reports.version}</version> </plugin> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <version>${maven.checkstyle.version}</version> <configuration> <configLocation>esri_checkstyle.xml</configLocation> <excludes>**/test/**</excludes> <headerLocation>${checkstyle_javaheader_file}</headerLocation> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>${maven.jxr.version}</version> <configuration> <aggregate>true</aggregate> </configuration> </plugin> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>${maven_javadoc_version}</version> <configuration> <source>${maven_java_version}</source> <aggregate>true</aggregate> <doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet> <docletArtifact> <groupId>gr.spinellis</groupId> <artifactId>UmlGraph</artifactId> <version>${maven_umlgraph_version}</version> </docletArtifact> <additionalparam> -inferrel -inferdep -quiet -hide java.* -collpackages java.util.* -qualify -postfixpackage -nodefontsize 9 -nodefontpackagesize 7 </additionalparam> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>${maven_surefire_report_version}</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${maven_cobertura_version}</version> <configuration> <formats> <format>xml</format> <format>html</format> </formats> </configuration> </plugin> <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>emma-maven-plugin</artifactId> <version>1.0-alpha-3</version> </plugin> --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>${maven_findbugs_version}</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>${maven_pmd_version}</version> <configuration> <targetJdk>${maven_java_version}</targetJdk> <linkXref>true</linkXref> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> <version>2.4</version> <configuration> <tags> <tag>fixme</tag> <tag>FixMe</tag> <tag>FIXME</tag> <tag>@todo</tag> <tag>todo</tag> <tag>TODO</tag> <tag>@deprecated</tag> </tags> </configuration> </plugin> </reportPlugins> </configuration> </plugin> <!-- <plugin> <groupId>com.googlecode.maven-java-formatter-plugin</groupId> <artifactId>maven-java-formatter-plugin</artifactId> <version>0.3.1</version> <configuration> <configFile>${project.basedir}/../eclipse_style.xml</configFile> </configuration> <executions> <execution> <goals> <goal>format</goal> </goals> </execution> </executions> </plugin> --> </plugins> </pluginManagement> </build>
CheckStyle
请注意,checkstyle可以接受一个定制的规则文件,比如我这里的叫my_checkstyle.xml。这是从eclipse中导出的。
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"><!-- This configuration file was written by the eclipse-cs plugin configuration editor--><!-- Checkstyle-Configuration: EsriRDC Sun Checks (Eclipse) Description: For EsriRDC--><module name="Checker"> <property name=<
版权声明:本文为fduffyyg原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。