Re: Changing site output location using system property

2024-04-04 Thread Michael Osipov
On 2024/03/27 21:23:30 Louis Bourdages wrote:
> Hi,
> 
> I'm trying to generate a failsafe report in a different location than the 
> standard one. Since this is to be used in a generic CI pipeline, I want to 
> avoid having to modify the plugin config in every repo.
> 
> I found this page which shows a system property that would appear to do 
> exactly what I need: 
> https://maven.apache.org/surefire/maven-surefire-report-plugin/examples/report-custom-location.html
> 
> I have however been unable to reproduce the behaviour. Running `mvn 
> surefire-report:report -DoutputDirectory=newpath` as per the example still 
> generates the reports in their normal location (`${basedir}/target/site`). Is 
> this documentation page outdated? Is there any way I can change the output 
> directory without requiring modifications in every repo?
> 
> I am using Maven  3.9.1 and surefire-report 3.2.5.

There are a few issues here, first of all use the lastest patch version of your 
minor Maven version.

The parameter you are trying to set is read-only: 
https://github.com/apache/maven-reporting-impl/blob/967e756d41c00c123c5c545676b5bffd35918970/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java#L79-L80
the next major version of maven-reporting-impl will fix this: 
https://github.com/apache/maven-reporting-impl/blob/8464ab92499b37677eadf60ef4661bd9c847b0ac/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java#L87-L88

If you are truly curious please build Surefire from this branch and try again: 
https://github.com/apache/maven-surefire/tree/doxia-2.0.0

Let me know,

Michael

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Changing site output location using system property

2024-03-27 Thread Louis Bourdages
Hi,

I'm trying to generate a failsafe report in a different location than the 
standard one. Since this is to be used in a generic CI pipeline, I want to 
avoid having to modify the plugin config in every repo.

I found this page which shows a system property that would appear to do exactly 
what I need: 
https://maven.apache.org/surefire/maven-surefire-report-plugin/examples/report-custom-location.html

I have however been unable to reproduce the behaviour. Running `mvn 
surefire-report:report -DoutputDirectory=newpath` as per the example still 
generates the reports in their normal location (`${basedir}/target/site`). Is 
this documentation page outdated? Is there any way I can change the output 
directory without requiring modifications in every repo?

I am using Maven  3.9.1 and surefire-report 3.2.5.

Thanks,

Louis