掘り、私は私の答えを見つけた: http://maven.apache.org/shared/maven-reporting-impl/index.html
と作業例:だから http://svn.apache.org/viewvc/maven/shared/tags/maven-reporting-impl-3.0.0/src/it/setup-reporting-plugin/
、基本的に、あなたはのpom.xmlでこれが必要になります:
<dependencies>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>@[email protected]</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.0</version>
</dependency>
<!-- plugin API and plugin-tools -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
そして、あなたの主なクラスがAbstractMavenReport
を拡張することがあります
import java.util.Locale;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
/**
* Typical code to copy as a reporting plugin start: choose the goal name, then implement getOutputName(),
* getName(Locale), getDescription(Locale) and of course executeReport(Locale).
*/
@Mojo(name = "custom")
public class CustomReport
extends AbstractMavenReport
{
public String getOutputName()
{
return "custom-report";
}
public String getName(Locale locale)
{
return "Custom Maven Report";
}
public String getDescription(Locale locale)
{
return "Custom Maven Report Description";
}
@Override
protected void executeReport(Locale locale)
throws MavenReportException
{
// direct report generation using Doxia: compare with CustomReportRenderer to see the benefits of using
// ReportRenderer
getSink().head();
getSink().title();
getSink().text("Custom Report Title");
getSink().title_();
getSink().head_();
getSink().body();
getSink().section1();
getSink().sectionTitle1();
getSink().text("section");
getSink().sectionTitle1_();
getSink().text("Custom Maven Report content.");
getSink().section1_();
getSink().body_();
}
}
今後のMaven Reportingプラグインの開発者の皆様のご協力をお願いいたします。 ;-)
そこにはたくさんのドキュメントはありません。あなたは何をしようとしているプラグインの種類を教えてください。あなたがしたことが最善のことです。既存のプラグインのコードを調べる。 あなたがしようとしていることについて少しお伝えすれば、コードを見るためのプラグインについて助言することができます。 –
私は、プロジェクトのソースコード(サードパーティエディタのプロプライエタリ言語で書かれています)に基づいてリファレンスガイドを作成するプラグインをビルドしようとしています。 Javadocのようなものですが、入力と構文が異なります。私は実際に私の答えを見つける(下記の答えを参照)。ありがとう! –