Hi
I tried again
<groupId>com.myorg</groupId>
<artifactId>my-report-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
...
/**
* @goal report
*/
public class MyReportMojo extends AbstractMavenReport {
/**
* @parameter default-value="${project.reporting.outputDirectory}"
*/
private File outputDirectory;
/**
* The Maven Project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
protected MavenProject project;
/**
* Doxia Site Renderer.
*
* @component
*/
protected Renderer siteRenderer;
protected void executeReport(Locale arg0) throws MavenReportException {
Sink sink = getSink();
sink.head();
String title = "MYTITLE";
sink.title();
sink.text(title);
sink.title_();
sink.head_();
sink.body();
sink.section1();
sink.text("BODY TEXT");
sink.section1_();
sink.body_();
sink.flush();
sink.close();
}
protected String getOutputDirectory() {
return outputDirectory.getAbsolutePath();
}
protected MavenProject getProject() {
return project;
}
protected Renderer getSiteRenderer() {
return siteRenderer;
}
public String getDescription(Locale arg0) {
return "My Site description";
}
public String getName(Locale arg0) {
return "My report";
}
public String getOutputName() {
return "myreport";
}
}
I am using this in another project:
...
<dependency>
<groupId>com.myorg</groupId>
<artifactId>my-report-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
...
<reporting>
<plugins>
<groupId>com.myorg</groupId>
<artifactId>my-report-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</plugins>
</reporting>
...
And when I execute
mvn site
from the command line all I get is
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getReportExecutions(DefaultLifecycleExecutor.java:931)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getReportExecutions(DefaultLifecycleExecutor.java:904)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:599)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
Can anyone tell me what I do wrong?
-----Ursprüngliche Nachricht-----
Von: Benson Margulies [mailto:[email protected]]
Gesendet: Montag, 27. Juni 2011 19:19
An: Maven Users List
Betreff: Re: simple maven 2 report plugin example
Read the source of one.
http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-changes-plugin
On Mon, Jun 27, 2011 at 12:37 PM, Frers,Michael <[email protected]> wrote:
> Hi
>
> can anyone help me out and sent me a simple "Hello World" maven report plugin
> example that works?
>
> I dont get a clue out of the documentation and I cant find a working example
> in the web.
>
> Thanks
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]