michael-o commented on code in PR #310: URL: https://github.com/apache/maven-plugin-tools/pull/310#discussion_r1697314336
########## maven-plugin-report-plugin/src/site/apt/examples/nofork.apt.vm: ########## @@ -0,0 +1,66 @@ + ------ + Generate Plugin Report without duplicate execution of phase process-classes. + ------ + Matt Nelson + ------ + 2024-07-29 + ------ + +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/doxia/references/apt-format.html + +Generate Plugin Report without duplicate execution of phase process-classes. + + * The standard goal <<<report>>> invokes separate lifecyle of <<<process-classes>>>. + + * In a CI environment you now might execute something like <<<mvn clean deploy site-deploy>>>. + + * During <<<site>>> build the standard reports will trigger <<<process-classes>>> again, depending on your build this may take some time, because + stuff like <<<enforcer>>> or generating stubs from a WDSL will be invoked again, which may lead + to longer build times. + + * See {{{https://issues.apache.org/jira/browse/MPLUGIN-529}MPLUGIN-529}} as well. + + * As of version 3.14.0 a new report is defined, <<<report-no-fork>>> which will not trigger above phase a second time. + + * Configure this in your <<<reporting>>> section as follows: + ++-----+ +<project> + ... + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-report-plugin</artifactId> + <version>${project.version}</version> + <reportSets> + <reportSet> + <reports> + <report>report-no-fork</report> + </reports> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> + ... +</project> ++-----+ Review Comment: I think this should be streamlined in one file: generate-report.apt.vm ########## maven-plugin-report-plugin/src/it/mplugin-529_nofork/verify.groovy: ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +assert new File( basedir, 'target/site/report-mojo.html' ).isFile() + +def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) +assert pluginInfo.isFile() + +assert !pluginInfo.text.contains('Memory') +assert !pluginInfo.text.contains('Disk Space') +// check JDK and Maven requirements +assert pluginInfo.text.contains('1.8') +assert pluginInfo.text.contains('3.9.6') + +// deprecated info and description +assert pluginInfo.text.contains('<div><strong>Deprecated.</strong> You don\'t use test goals, do you?</div><br />') +assert pluginInfo.text.contains('Does nothing.') + +assert new File( basedir, 'target/site/de/noop-mojo.html' ).isFile() +assert new File( basedir, 'target/site/de/report-mojo.html' ).isFile() +assert new File( basedir, 'target/site/de/plugin-info.html' ).isFile() + +assert new File( basedir, 'target/site/fr/noop-mojo.html' ).isFile() +assert new File( basedir, 'target/site/fr/report-mojo.html' ).isFile() +assert new File( basedir, 'target/site/fr/plugin-info.html' ).isFile() + +def noopMojo = new File( basedir, 'target/site/noop-mojo.html' ) +assert noopMojo.isFile() + +// deprecated in table and details +assert noopMojo.text.count('<div><strong>Deprecated.</strong><br />Just testing.</div><br />') == 2 + +assert 1 == new File( basedir, 'build.log' ).text.count('Always pass!'); Review Comment: For the sake of consistency, then this IT should be called `plugin-no-fork-report` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org