[ https://issues.apache.org/jira/browse/MCHECKSTYLE-407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724718#comment-17724718 ]
Nas Kavian commented on MCHECKSTYLE-407: ---------------------------------------- Thanks for following up. ---- I figured out today one of the issues. I changed {code:java} <excludes> <exclude>**/*IntegrationTest.java</exclude> </excludes> <includes> <include>**/*Test.java</include> </includes> {code} to {code:java} <excludes>**/*IntegrationTest.java</excludes> <includes>**/*Test.java</includes> {code} Although this configuration change was in the checkstyle section, it was contingent on the surefire version. Apparently this was okay in maven-surefire-plugin 2.22.1 but the behavior changed when upgrading to 3.X. ---- The last remaining issue is about code coverage. Version 3.0.0-M4 of the plugin produces the expected output in the coverage report, but version 3.0.0-M5 shows all code coverage as 0%. I tried to spend time trimming down the project but it's a challenge. Are you able to debug between versions M4 and M5 or are you blocked without a sample project? > Maven Site + Surefire + Checkstyle fails to build > ------------------------------------------------- > > Key: MCHECKSTYLE-407 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-407 > Project: Maven Checkstyle Plugin > Issue Type: Bug > Components: checkstyle:check > Affects Versions: 3.1.2 > Environment: Apache Maven 3.8.1 > (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/local/Cellar/maven/3.8.1/libexec > Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: > /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac" > Reporter: Nas Kavian > Priority: Major > Fix For: waiting-for-feedback > > > Summary: > * when I use checkstyle with phase=validate, `mvn site` works. > * when I use checkstyle with phase=test, `mvn site` fails with an error: > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on > project payments-web: failed to get report for > org.apache.maven.plugins:maven-surefire-report-plugin: Failed to execute goal > org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check (default) on > project payments-web: Unable to parse configuration of mojo > org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check: Basic element > 'excludes' must not contain child elements > The checkstyle configuration looks like this: > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-checkstyle-plugin</artifactId> > <version>3.1.2</version> > <executions> > <execution> > <phase>test</phase> > <goals> > <goal>check</goal> > </goals> > </execution> > </executions> > </plugin> > > The surefire configuration looks like this: > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-surefire-plugin</artifactId> > <version>3.0.0-M5</version> > <configuration> > <excludes> > <exclude>${exclude.tests}</exclude> > </excludes> > <groups>${tests}</groups> > <includes> > <include>**/*Test.java</include> > </includes> > </configuration> > </plugin> > > The error about "excludes" is referring to the "excludes" in the surefire > plugin. > > This is a partial stacktrace: > > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on > project payments-web: failed to get report for > org.apache.maven.plugins:maven-surefire-report-plugin > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:215) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > ... > ... > Caused by: org.apache.maven.plugin.MojoExecutionException: failed to get > report for org.apache.maven.plugins:maven-surefire-report-plugin > at > org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports > (DefaultMavenReportExecutor.java:159) > at > org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo.getReports > (AbstractSiteRenderingMojo.java:226) > ... > ... > Caused by: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to > execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check > (default) on project payments-web: Unable to parse configuration of mojo > org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check: Basic element > 'excludes' must not contain child elements > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:215) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > ... > ... > Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to > parse configuration of mojo > org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:check: Basic element > 'excludes' must not contain child elements > at > org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields > (DefaultMavenPluginManager.java:665) > at > org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo > (DefaultMavenPluginManager.java:597) > ... > ... > Caused by: > org.codehaus.plexus.component.configurator.ComponentConfigurationException: > Basic element 'excludes' must not contain child elements > at > org.codehaus.plexus.component.configurator.converters.basic.AbstractBasicConverter.fromConfiguration > (AbstractBasicConverter.java:34) > at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty > (CompositeBeanHelper.java:273) > at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty > (CompositeBeanHelper.java:210) > at > org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration > (ObjectWithFieldsConverter.java:101) > at > org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent > (BasicComponentConfigurator.java:34) > at > org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields > (DefaultMavenPluginManager.java:635) > at > org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo > (DefaultMavenPluginManager.java:597) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:124) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:210) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148) > at > org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions > (MojoExecutor.java:355) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeForkedExecutions > (DefaultLifecycleExecutor.java:173) > at > org.apache.maven.reporting.exec.DefaultMavenReportExecutor.prepareReportExecution > (DefaultMavenReportExecutor.java:356) > at > org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin > (DefaultMavenReportExecutor.java:189) > at > org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports > (DefaultMavenReportExecutor.java:154) > at > org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo.getReports > (AbstractSiteRenderingMojo.java:226) > at org.apache.maven.plugins.site.render.SiteMojo.execute > (SiteMojo.java:115) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:137) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:210) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81) > at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56) > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) > at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) > at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) > at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:498) > at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282) > at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225) > at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406) > at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347) -- This message was sent by Atlassian Jira (v8.20.10#820010)