You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by animator <l....@gmail.com> on 2014/11/26 22:42:03 UTC
Integrate Maven Site reporting with maven plugin that externally
create report html page.
I'm developing maven plugin
(https://github.com/lgadawski/cloverage-maven-plugin). This plugin produces
code coverage report for clojure sources from project. This report (html
page) is generated by cloverage (clojure library as dependency in my maven
plugin). The problem is that I would like to link this generated html file
to maven site reporting section. Is that possible to achieve this
automagically? Any suggestions?
My Mojo extends AbstractMavenReport and after calling 'mvn site' I get link
in "Project Reports" section. How to link there generated earlier html page?
Thanks for any ansewrs!
--
View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that externally create report html page.
Posted by Hervé BOUTEMY <he...@free.fr>.
notice given our useful discussion, I just opened
http://jira.codehaus.org/browse/MSHARED-389 and fixed it
Regards,
Hervé
Le samedi 6 décembre 2014 17:44:33 Hervé BOUTEMY a écrit :
> in AbstractCloverageMojo.java,
>
> @Parameter(defaultValue = "${basedir}/target/coverage")
> protected File reportOutputDirectory;
>
> should be replaced by
>
> @Parameter(defaultValue = "${project.reporting.outputDirectory}/coverage")
> protected File reportOutputDirectory;
>
> to have the content generated inside the site
>
> and
> private static final String OUTPUT_NAME = "indexx";
> should be
> private static final String OUTPUT_NAME = "coverage/indexx";
>
> to make the menu link point to the generated content.
>
> Regards,
>
> Hervé
>
> Le jeudi 4 décembre 2014 08:48:25 animator a écrit :
> > Here is my mojo:
> > https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/j
> > av a/com/gadawski/maven/plugins/cloverage/goals/HtmlMojo.java
> >
> > which, as U can see, extends following class:
> > https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/j
> > av a/com/gadawski/maven/plugins/cloverage/goals/AbstractCloverageMojo.java
> >
> > While invoking #executeReport(...) it calls external clojure library that
> > performs instrumentation on test project and produces html report in
> > '${project}/coverage/index.html'. l would like link those externally
> > generated report to my maven site reports section..
> >
> > Here is test project: https://github.com/lgadawski/test-polyglot-project
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven
> > -> plugin-that-externally-create-report-html-page-tp5817068p5817929.html
> > Sent from the Maven Developers mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that
externally create report html page.
Posted by animator <l....@gmail.com>.
Thank U so much!
--
View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068p5818389.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that externally create report html page.
Posted by Hervé BOUTEMY <he...@free.fr>.
in AbstractCloverageMojo.java,
@Parameter(defaultValue = "${basedir}/target/coverage")
protected File reportOutputDirectory;
should be replaced by
@Parameter(defaultValue = "${project.reporting.outputDirectory}/coverage")
protected File reportOutputDirectory;
to have the content generated inside the site
and
private static final String OUTPUT_NAME = "indexx";
should be
private static final String OUTPUT_NAME = "coverage/indexx";
to make the menu link point to the generated content.
Regards,
Hervé
Le jeudi 4 décembre 2014 08:48:25 animator a écrit :
> Here is my mojo:
> https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/jav
> a/com/gadawski/maven/plugins/cloverage/goals/HtmlMojo.java
>
> which, as U can see, extends following class:
> https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/jav
> a/com/gadawski/maven/plugins/cloverage/goals/AbstractCloverageMojo.java
>
> While invoking #executeReport(...) it calls external clojure library that
> performs instrumentation on test project and produces html report in
> '${project}/coverage/index.html'. l would like link those externally
> generated report to my maven site reports section..
>
> Here is test project: https://github.com/lgadawski/test-polyglot-project
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-> plugin-that-externally-create-report-html-page-tp5817068p5817929.html Sent
> from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that
externally create report html page.
Posted by animator <l....@gmail.com>.
Here is my mojo:
https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/java/com/gadawski/maven/plugins/cloverage/goals/HtmlMojo.java
which, as U can see, extends following class:
https://github.com/lgadawski/cloverage-maven-plugin/blob/master/src/main/java/com/gadawski/maven/plugins/cloverage/goals/AbstractCloverageMojo.java
While invoking #executeReport(...) it calls external clojure library that
performs instrumentation on test project and produces html report in
'${project}/coverage/index.html'. l would like link those externally
generated report to my maven site reports section..
Here is test project: https://github.com/lgadawski/test-polyglot-project
--
View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068p5817929.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that
externally create report html page.
Posted by animator <l....@gmail.com>.
Yes that't true and I get my report being generated. But after that I would
like to embed link to my externally created report in site reporting
section..
So firstly I execute 'mvn site'. Because I declared my plugin in reporting
section my Mojo that extends AbstractMavenReport is invoked and creates
external report in '${project}/coverage/index.html'. Next site generation is
finished and I get project site. And I expect to have my generated report to
be included in 'Project reports' but I don't know how to embed my custom
link in this section.
Regards.
--
View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068p5817817.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that externally create report html page.
Posted by Hervé BOUTEMY <he...@free.fr>.
there was a misunderstanding: when isExternal() returns true, there is no
Doxia generation, but Report.generate() is called
you should call the generation engine from generate(): IIUC, you're calling
the generation engine from another point, and that's the problem
Regards,
Hervé
Le mardi 2 décembre 2014 10:44:43 animator a écrit :
> Thx @Herve BOUTEMY for answer, but when I override isExternal() to return
> true nothing changes.. The same report generation is invoked after executing
> 'mvn site'. I spent hours and couldn't find, but may be is it possible to
> reference concrete report link in site reporting section? e.g.
> '${project}/coverage/index.html' instead of automatically generated?
>
> Regards.
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-> plugin-that-externally-create-report-html-page-tp5817068p5817786.html Sent
> from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that
externally create report html page.
Posted by animator <l....@gmail.com>.
Thx @Herve BOUTEMY for answer, but when I override isExternal() to return
true nothing changes.. The same report generation is invoked after executing
'mvn site'. I spent hours and couldn't find, but may be is it possible to
reference concrete report link in site reporting section? e.g.
'${project}/coverage/index.html' instead of automatically generated?
Regards.
--
View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068p5817786.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that externally create report html page.
Posted by Hervé BOUTEMY <he...@free.fr>.
that's the purpose of isExternalReport() method of reporting-api: [1]
Just implement it as "return true;" and no content will be generated by m-
site-p/Doxia: it is expected that the tool will generated the page
you can have a look at m-javadoc-p, that's exactly what is done here
Regards,
Hervé
[1] http://maven.apache.org/shared/maven-reporting-api/apidocs/org/apache/maven/reporting/MavenReport.html
Le mercredi 26 novembre 2014 14:42:03 animator a écrit :
> I'm developing maven plugin
> (https://github.com/lgadawski/cloverage-maven-plugin). This plugin produces
> code coverage report for clojure sources from project. This report (html
> page) is generated by cloverage (clojure library as dependency in my maven
> plugin). The problem is that I would like to link this generated html file
> to maven site reporting section. Is that possible to achieve this
> automagically? Any suggestions?
> My Mojo extends AbstractMavenReport and after calling 'mvn site' I get link
> in "Project Reports" section. How to link there generated earlier html page?
>
> Thanks for any ansewrs!
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-> plugin-that-externally-create-report-html-page-tp5817068.html Sent from the
> Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Integrate Maven Site reporting with maven plugin that externally
create report html page.
Posted by Grzegorz Słowikowski <gs...@gmail.com>.
Hi Lukasz
I didn't check, but your plugin must be very similar to one I wrote
recently for SCoverage
(Scala coverage) https://github.com/scoverage/scoverage-maven-plugin
Look at this class:
https://github.com/scoverage/scoverage-maven-plugin/blob/master/src/main/java/org/scoverage/plugin/SCoverageReportMojo.java
Regards
Grzegorz Slowikowski
On 2014-11-26 22:42, animator wrote:
> I'm developing maven plugin
> (https://github.com/lgadawski/cloverage-maven-plugin). This plugin produces
> code coverage report for clojure sources from project. This report (html
> page) is generated by cloverage (clojure library as dependency in my maven
> plugin). The problem is that I would like to link this generated html file
> to maven site reporting section. Is that possible to achieve this
> automagically? Any suggestions?
> My Mojo extends AbstractMavenReport and after calling 'mvn site' I get link
> in "Project Reports" section. How to link there generated earlier html page?
>
> Thanks for any ansewrs!
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Integrate-Maven-Site-reporting-with-maven-plugin-that-externally-create-report-html-page-tp5817068.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org