我刚刚通过添加构建插件'org.pitest:pitest-maven:1.2.4'在我的maven项目上配置了PiTest,但是当我运行mvn时,请编译org.pitest:pitest-maven:mutationCoverage或mvn org.pitest: pitest-maven:mutationCoverage即使在从此stacktrace开始之前也失败。 (MVN -X org.pitest:pitest-maven:mutationCoverage)
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.11:mutationCoverage (default-cli) on project myMavenApplication: Execution default-cli of goal org.pitest:pitest-maven:1.1.11:mutationCoverage failed: Illegal repetition near index 2
[ERROR] ^\${test\.excludes}$
[ERROR] ^
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.1.11:mutationCoverage (default-cli) on project myMavenApplication: Execution default-cli of goal org.pitest:pitest-maven:1.1.11:mutationCoverage failed: Illegal repetition near index 2
^\${test\.excludes}$
^
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.pitest:pitest-maven:1.1.11:mutationCoverage failed: Illegal repetition near index 2
^\${test\.excludes}$
^
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.util.regex.PatternSyntaxException: Illegal repetition near index 2
^\${test\.excludes}$
^
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.closure(Pattern.java:3157)
at java.util.regex.Pattern.sequence(Pattern.java:2134)
at java.util.regex.Pattern.expr(Pattern.java:1996)
at java.util.regex.Pattern.compile(Pattern.java:1696)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at org.pitest.util.Glob.<init>(Glob.java:32)
at org.pitest.maven.SurefireConfigConverter$1.apply(SurefireConfigConverter.java:63)
at org.pitest.maven.SurefireConfigConverter$1.apply(SurefireConfigConverter.java:60)
at org.pitest.functional.FCollection.mapTo(FCollection.java:40)
at org.pitest.functional.FCollection.map(FCollection.java:48)
at org.pitest.maven.SurefireConfigConverter.convertExcludes(SurefireConfigConverter.java:53)
at org.pitest.maven.SurefireConfigConverter.update(SurefireConfigConverter.java:25)
at org.pitest.maven.MojoToReportOptionsConverter.updateFromSurefire(MojoToReportOptionsConverter.java:183)
at org.pitest.maven.MojoToReportOptionsConverter.convert(MojoToReportOptionsConverter.java:79)
at org.pitest.maven.AbstractPitMojo.analyse(AbstractPitMojo.java:403)
at org.pitest.maven.AbstractPitMojo.execute(AbstractPitMojo.java:348)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
最佳答案
解决:在pom的某一点有一个属性的用法($ {test.excludes})而不是pom的声明的问题