我为SonarQube开发了一个插件,用于扫描依赖项。 pom.xml设置正确,因为当我将一个Sonarqube实例运行时,将plugin.jar放入下载时,SonarQube将其识别为插件。
但是,当我重新启动时,sonarqube会在没有错误的情况下关闭。
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader@5c647e05
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | Wrapper Manager: JVM #1
jvm 1 | Running a 64-bit JVM.
jvm 1 | Wrapper Manager: Registering shutdown hook
jvm 1 | Wrapper Manager: Using wrapper
jvm 1 | Load native library. One or more attempts may fail if platform specific libraries do not exist.
jvm 1 | Loading native library failed: wrapper-windows-x86-64.dll Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-64 in java.library.path
jvm 1 | Loaded native library: wrapper.dll
jvm 1 | Calling native initialization method.
jvm 1 | Initializing WrapperManager native library.
jvm 1 | Java Executable: C:\Program Files\Java\jdk1.8.0_101\bin\java.exe
jvm 1 | Windows version: 10.0.14393
jvm 1 | Java Version : 1.8.0_101-b13 Java HotSpot(TM) 64-Bit Server VM
jvm 1 | Java VM Vendor : Oracle Corporation
jvm 1 |
jvm 1 | Control event monitor thread started.
jvm 1 | Startup runner thread started.
jvm 1 | WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@38af3868, args[]) called by thread: main
jvm 1 | Communications runner thread started.
jvm 1 | Open socket to wrapper...Wrapper-Connection
jvm 1 | Opened Socket from 31000 to 32000
jvm 1 | Send a packet KEY : 2GTtSqz0GtFRhODS
jvm 1 | handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
jvm 1 | Received a packet LOW_LOG_LEVEL : 1
jvm 1 | Wrapper Manager: LowLogLevel from Wrapper is 1
jvm 1 | Received a packet PING_TIMEOUT : 0
jvm 1 | PingTimeout from Wrapper is 0
jvm 1 | Received a packet PROPERTIES : (Property Values)
jvm 1 | Received a packet START : start
jvm 1 | calling WrapperListener.start()
jvm 1 | Waiting for WrapperListener.start runner thread to complete.
jvm 1 | WrapperListener.start runner thread started.
jvm 1 | WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
jvm 1 | WrapperSimpleApp: invoking main method
jvm 1 | 2017.03.24 10:11:33 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube\temp
jvm 1 | 2017.03.24 10:11:34 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[es]: C:\Program Files\Java\jdk1.8.0_101\jre\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\sonarqube\temp -javaagent:C:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\sonarqube\temp\sq-process7604452175831354499properties
jvm 1 | Send a packet START_PENDING : 5000
jvm 1 | Send a packet START_PENDING : 5000
jvm 1 | WrapperSimpleApp: start(args) end. Main Completed=false, exitCode=null
jvm 1 | WrapperListener.start runner thread stopped.
jvm 1 | returned from WrapperListener.start()
jvm 1 | Send a packet STARTED :
jvm 1 | Startup runner thread stopped.
jvm 1 | Received a packet PING : ping
jvm 1 | Send a packet PING : ok
jvm 1 | Received a packet PING : ping
jvm 1 | Send a packet PING : ok
jvm 1 | 2017.03.24 10:11:43 INFO app[o.s.p.m.Monitor] Process[es] is up
jvm 1 | 2017.03.24 10:11:43 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jdk1.8.0_101\jre\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=C:\sonarqube\temp -javaagent:C:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar -cp ./lib/common/*;./lib/server/*;C:\sonarqube\lib\jdbc\h2\h2-1.3.176.jar org.sonar.server.app.WebServer C:\sonarqube\temp\sq-process8001231277797444929properties
jvm 1 | Received a packet PING : ping
jvm 1 | Send a packet PING : ok
jvm 1 | Received a packet PING : ping
jvm 1 | Send a packet PING : ok
jvm 1 | 2017.03.24 10:11:52 INFO app[o.s.p.m.Monitor] Process[es] is stopping
jvm 1 | 2017.03.24 10:11:53 INFO app[o.s.p.m.Monitor] Process[es] is stopped
jvm 1 | Wrapper Manager: ShutdownHook started
jvm 1 | WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
jvm 1 | Send a packet STOP : 0
jvm 1 | Received a packet STOP :
jvm 1 | Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
jvm 1 | calling listener.stop()
jvm 1 | WrapperSimpleApp: stop(0)
jvm 1 | returned from listener.stop() -> 0
jvm 1 | shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
jvm 1 | Send a packet STOPPED : 0
jvm 1 | Closing socket.
jvm 1 | Wrapper Manager: ShutdownHook complete
jvm 1 | Server daemon shut down
wrapper | <-- Wrapper Stopped
另外我的传感器和插件类:
public final class SonarDependencyPlugin implements Plugin {
public void define(final Context context) {
context.addExtensions(SonarDependencyMetrics.class,SonarDependencySensor.class);
}
}
+
public class SonarDependencySensor implements Sensor {
CouplingScanner scanner;
public void describe(SensorDescriptor descriptor) {
descriptor.name("SonarDependency sensor");
}
public void execute(SensorContext context) {
this.scanner=new CouplingScanner(context.fileSystem().baseDir());
scanner.scan();
}
}
My Scanner基本上可以独立工作,只需要一个目录。
我只是希望sonarqube不先关机,所以我会担心以后会保存指标。感谢任何帮助。谢谢!
已解决:查看您的installDirectory / sonarqube / logs文件并查看错误列表。并非所有错误都显示在控制台中。我的错误特定于我的项目(使用我正在使用的另一个插件的Metric nameconflict)