There is an article on the Internet: http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin
I talked about some basic operations, but the example is really simple for people familiar with report-plugin development, and it is a little complicated for people who are not familiar with it. So the example is not good.
Although the previous article is simple, the example is simple and easy to understand.
Use this plug-in with another Maven program.
Pom. XML is used as follows:
<build> <plugins> <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-site-plugin</artifactId><version>3.0</version><configuration> <reportPlugins> <plugin> <groupId>org.freebird</groupId> <artifactId>myreport</artifactId> <version>1.0-SNAPSHOT</version> </plugin> </reportPlugins></configuration> </plugin> </plugins> </build>
Run the MVN clean package site command and check the file in the target directory:
chenshu@ubuntu:~/NetBeansProjects/mavenproject1/target$ tree.└── site ├── css │ ├── maven-base.css │ ├── maven-theme.css │ ├── print.css │ └── site.css ├── images │ ├── collapsed.gif │ ├── expanded.gif │ ├── external.png │ ├── icon_error_sml.gif │ ├── icon_info_sml.gif │ ├── icon_success_sml.gif │ ├── icon_warning_sml.gif │ ├── logos │ │ ├── build-by-maven-black.png │ │ ├── build-by-maven-white.png │ │ └── maven-feather.png │ └── newwindow.png ├── myreport-output.html └── project-reports.html4 directories, 17 files
The name of the myreport-output.html file is obtained by calling my report1.getoutputname () method by MVN site.
Open the target/site/project-report.html file in a browser and you will see:
Project name: mavenproject1
The myreport-name returned by report1.getname appears in the document column on the left and overview.
The myreport-description returned by report1.getdescription appears in the overview description.
If you click the myreport-name link on the left, you will see hello World.
However, the outputdirecotry setting seems useless.