mavne install 报错org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.Invoca

Posted testway

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mavne install 报错org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.Invoca相关的知识,希望对你有一定的参考价值。

maven install 报错

org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
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:497)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.apache.maven.surefire.testset.TestSetFailedException: Unknown TestNG version 6.9.13.6
at org.apache.maven.surefire.testng.TestNGExecutor.getConfigurator(TestNGExecutor.java:207)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:72)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:110)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:106)
... 9 more

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

 

解决办法:

pom.xml 文件中添加

<build> 
    <plugins>          
       <plugin>      
        <groupId>org.apache.maven.plugins</groupId>          
        <artifactId>maven-surefire-plugin</artifactId>          
        <version>2.19.1</version>        
        <configuration>            
        <skipTests>false</skipTests>        
        </configuration>      
        </plugin>  
     </plugins> 
</build>

 

















以上是关于mavne install 报错org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.Invoca的主要内容,如果未能解决你的问题,请参考以下文章

Mavne 排除 jar 包 中的目录文件和资源文件

mavn依赖报错终极解决方案

mvn 编译报错mavn sun.security.validator.ValidatorException: PKIX path building failed: sun.security.prov

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apach

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apach

idea中导包出现import org.apach.*,提交代码老出现冲突,不想使用.*的设置