我无法构建maven项目,因为测试用例未被执行。 我低于错误。同样的错误我在Jenkins也有,我也无法执行构建,我必须跳过测试用例
#include <stdio.h>
#include <string.h>
#include <espeak/speak_lib.h>
static void say(const char *text)
{
static int initialized = 0;
if (! initialized) {
espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, 0, NULL, 0);
espeak_SetVoiceByName("en");
initialized = 1;
}
espeak_Synth(text, strlen(text)+1,
0, POS_CHARACTER, 0,
espeakCHARS_UTF8, NULL, NULL);
espeak_Synchronize();
}
int main()
{
char text[1000];
int i;
for (i = 0; i < 5; ++i) {
scanf("%s", text);
say(text);
}
return 0;
}
我的POM看起来像这样
Forking command line: cmd.exe /X /C ""C:\Program Files\Java\jdk1.7.0_80\jre\bin\java" -XX:-UseSplitVerifier -jar D:\Ankush\Codes\RIN\0537-logistics-bit-c-rin\main\rin\rin-common\target\surefire\surefirebooter8137375113015923041.jar D:\Ankush\Codes\RIN\0537-logistics-bit-c-rin\main\rin\rin-common\target\surefire\surefire2656883459599824975tmp D:\Ankush\Codes\RIN\0537-logistics-bit-c-rin\main\rin\rin-common\target\surefire\surefire_083819702813080247tmp"
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.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:130)
at org.apache.maven.surefire.booter.SurefireReflector.instantiateProvider(SurefireReflector.java:239)
at org.apache.maven.surefire.booter.ProviderFactory.createProvider(ProviderFactory.java:122)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
Caused by: org.apache.maven.surefire.util.SurefireReflectionException: java.lang.ClassNotFoundException: org.sonar.java.jacoco.JUnitListener; nested exception is java.lang.ClassNotFoundException: org.sonar.java.jacoco.JUnitListener
at org.apache.maven.surefire.util.ReflectionUtils.loadClass(ReflectionUtils.java:236)
at org.apache.maven.surefire.util.ReflectionUtils.instantiate(ReflectionUtils.java:109)
at org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners(JUnit4RunListenerFactory.java:43)
at org.apache.maven.surefire.junit4.JUnit4Provider.<init>(JUnit4Provider.java:81)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.sonar.java.jacoco.JUnitListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:97)
at org.apache.maven.surefire.util.ReflectionUtils.loadClass(ReflectionUtils.java:228)
... 13 more
版本是正确的,我也检查了其他maven项目 根据它们,POM看起来很正常但是这个问题在其他组件构建中永远不会出现。
答案 0 :(得分:0)
你正在使用一个非常古老的声纳-maven插件。你应该改成这个插件:
<!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>
...而且我不确定你是否应该宣布它是一个万无一失的<dependency>
(因为它必须可以肯定地提供)
另外,是的,您需要在<plugins>
中包含此定义(<pluginManagement>
是一种在不实际使用的情况下全局配置插件的方法。然后在<plugins>
中您使用Marker marker = new Marker() ;
marker.setTag(position);// you can give ArrayList position and then get in on marker click method.
激活&#39;
答案 1 :(得分:0)