- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 SonarQube 与 GitLab CI 集成,但出现以下错误:
[ERROR] Unknown lifecycle phase ".qualitygate.wait=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site
我有一个带有 Maven 的 Spring Boot 项目。我像文档中一样编辑了 Maven settings.xml 以在其中添加 Sonar 。
这是我的日志文件:
Running with gitlab-runner 13.3.1 (738bbe5a)
on Default runner 77Lxte6S
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on DESKTOP-CMAC9J3...
Getting source from Git repository
00:02
Fetching changes...
Reinitialized existing Git repository in C:/Fontys/CI Runner/builds/77Lxte6S/0/I426015/its_georgi_manev_s3/.git/
Checking out 6fddf4a4 as master...
Removing target/
git-lfs/2.9.2 (GitHub; windows amd64; go 1.12.7; git 0274d856)
Skipping Git submodules setup
Restoring cache
Version: 13.3.1
Git revision: 738bbe5a
Git branch: 13-3-stable
GO version: go1.13.8
Built: 2020-08-25T12:29:07+0000
OS/Arch: windows/386
Checking cache for sonarqube-check...
Runtime platform arch=386 os=windows pid=14048 revision=738bbe5a version=13.3.1
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
Executing "step_script" stage of the job script
00:23
$ mvn verify sonar:sonar -Dsonar.qualitygate.wait=true
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< com.its:ITS >-----------------------------
[INFO] Building ITS 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ ITS ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ ITS ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ ITS ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ ITS ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ ITS ---
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ ITS ---
[INFO] Building jar: C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\target\ITS-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.3.4.RELEASE:repackage (repackage) @ ITS ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] ----------------------------< com.its:ITS >-----------------------------
[INFO] Building ITS 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ ITS ---
[INFO] User cache: C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\.sonar\cache
[INFO] SonarQube version: 8.5.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Load global settings
[INFO] Load global settings (done) | time=87ms
[INFO] Server id: BF41A1F2-AXUskNJ7IDe8fi-slcI-
[INFO] User cache: C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\.sonar\cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=55ms
[INFO] Load/download plugins (done) | time=106ms
[INFO] Process project properties
[INFO] Process project properties (done) | time=10ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=3ms
[INFO] Project key: com.its:ITS
[INFO] Base dir: C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3
[INFO] Working dir: C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\target\sonar
[INFO] Load project settings for component key: 'com.its:ITS'
[INFO] Load project settings for component key: 'com.its:ITS' (done) | time=16ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=48ms
[INFO] Auto-configuring with CI 'Gitlab CI'
[INFO] Load active rules
[INFO] Load active rules (done) | time=1041ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 8 files indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for java: Java NO CORS
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module ITS
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=20ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 11
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=12ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=6ms
[INFO] Java Main Files AST scan
[INFO] 6 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=14ms
[INFO] 6/6 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=1659ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[INFO] Java Test Files AST scan (done) | time=66ms
[INFO] 1/1 source files have been analyzed
[INFO] Java Generated Files AST scan
[INFO] 0 source files to be analyzed
[INFO] Java Generated Files AST scan (done) | time=1ms
[INFO] 0/0 source files have been analyzed
[INFO] Sensor JavaSquidSensor [java] (done) | time=1884ms
[INFO] Sensor CSS Rules [cssfamily]
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [cssfamily] (done) | time=2ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=1ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [C:\Fontys\CI Runner\builds\77Lxte6S\0\I426015\its_georgi_manev_s3\target\surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=78ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=185ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=4ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=114ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor VB.NET Properties [vbnet]
[INFO] Sensor VB.NET Properties [vbnet] (done) | time=1ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=10ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=24ms
[INFO] SCM Publisher SCM provider for this project is: git
[INFO] SCM Publisher 1 source file to be analyzed
[INFO] SCM Publisher 1/1 source file have been analyzed (done) | time=211ms
[INFO] CPD Executor 3 files had no CPD blocks
[INFO] CPD Executor Calculating CPD for 3 files
[INFO] CPD Executor CPD calculation finished (done) | time=7ms
[INFO] Analysis report generated in 79ms, dir size=106 KB
[INFO] Analysis report compressed in 137ms, zip size=27 KB
[INFO] Analysis report uploaded in 39ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=com.its%3AITS
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AXVAanQEcFRPLb2nDbPG
[INFO] Analysis total time: 5.924 s
[INFO]
[INFO] ----------------------------< com.its:ITS >-----------------------------
[INFO] Building ITS 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.449 s
[INFO] Finished at: 2020-10-19T12:31:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".qualitygate.wait=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
ERROR: Job failed: exit status 1
仅当我运行管道时才会发生这种情况,而当我在 cmd 中运行 mvn verify sonar:sonar -Dsonar.qualitygate.wait=true 时,我不会收到任何错误。
这是来自 cmd 的日志(缩写):
[INFO] Scanning for projects...
[INFO]
[INFO] ------< com.its:ITS >---------
[INFO] Building ITS 0.0.1-SNAPSHOT
[INFO] =----------[ jar ]-------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ ITS ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ ITS ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ ITS ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Eclipse IDE n gfish\eclipseWorkSpace\ddemorest\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ ITS ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ ITS ---
[INFO]
[INFO] ----------< com.its:ITS >--------
[INFO] Building ITS 0.0.1-SNAPSHOT
[INFO] ------[ jar ]---------
[INFO]
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ ITS ---
[INFO] User cache: C:\Users\Joro\.sonar\cache
[INFO] SonarQube version: 8.5.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Load global settings
[INFO] Load global settings (done) | time=79ms
[INFO] Server id: BF41A1F2-AXUskNJ7IDe8fi-slcI-
[INFO] User cache: C:\Users\Joro\.sonar\cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=76ms
[INFO] Load/download plugins (done) | time=154ms
[INFO] Process project properties
[INFO] Process project properties (done) | time=17ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=4ms
[INFO] Project key: com.its:ITS
[INFO] Base dir: E:\Eclipse IDE n gfish\eclipseWorkSpace\ddemorest
[INFO] Working dir: E:\Eclipse IDE n gfish\eclipseWorkSpace\ddemorest\target\sonar
[INFO] Load project settings for component key: 'com.its:ITS'
[INFO] Load project settings for component key: 'com.its:ITS' (done) | time=20ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=96ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1057ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 8 files indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for java: Java NO CORS
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module ITS
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=21ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 11
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=18ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=8ms
[INFO] Java Main Files AST scan
[INFO] 6 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=20ms
[INFO] 6/6 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=1670ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[INFO] Java Test Files AST scan (done) | time=68ms
[INFO] 1/1 source files have been analyzed
[INFO] Java Generated Files AST scan
[INFO] 0 source files to be analyzed
[INFO] Java Generated Files AST scan (done) | time=6ms
[INFO] 0/0 source files have been analyzed
[INFO] Sensor JavaSquidSensor [java] (done) | time=1931ms
[INFO] Sensor CSS Rules [cssfamily]
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [cssfamily] (done) | time=9ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=21ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=7ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [E:\Eclipse IDE n gfish\eclipseWorkSpace\ddemorest\target\surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=84ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=153ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=7ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=122ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor VB.NET Properties [vbnet]
[INFO] Sensor VB.NET Properties [vbnet] (done) | time=6ms
[INFO] ---- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=14ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=25ms
[INFO] CPD Executor 3 files had no CPD blocks
[INFO] CPD Executor Calculating CPD for 3 files
[INFO] CPD Executor CPD calculation finished (done) | time=9ms
[INFO] Analysis report generated in 103ms, dir size=105 KB
[INFO] Analysis report compressed in 117ms, zip size=27 KB
[INFO] Analysis report uploaded in 44ms
[INFO] ------Check Quality Gate status
[INFO] Waiting for the analysis report to be processed (max 300s)
[INFO] QUALITY GATE STATUS: PASSED - View details on http://localhost:9000/dashboard?id=com.its%3AITS
[INFO] Analysis total time: 11.358 s
[INFO] BUILD SUCCESS
这是我的 .gitlab-ci.yml 配置:
maven_build:
stage: test
script:
- echo "Maven build started"
- echo "$TEST"
- mvn verify
sonarqube-check:
image: maven:3.6.3-jdk-11
variables:
SONAR_TOKEN: "hidden"
SONAR_HOST_URL: "http://localhost:9000"
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar -Dsonar.qualitygate.wait=true
allow_failure: true
only:
- merge_requests
- master
- develop
最佳答案
正确答案:
-mvn clean install
-mvn "-Dsonar.qualitygate=true" sonar:sonar
-Dsonar.qualitygate=true
应放在引号中并位于 mvn
之后。
显然这是 Windows shell 的一些问题。
关于spring - 未知生命周期阶段 ".qualitygate.wait=true",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64426026/
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
我正在尝试将 JSON 发送到我的服务器并作为结果检索 JSON。例如发送用户名和密码并取回 token 和其他内容。 这就是我正在为发送的 HTTP 请求所做的。我现在如何检索同一请求中的内容?
我有以下 xts 矩阵: > options(digits.secs = 6) > set.seed(1234) > xts(1:10, as.POSIXlt(1366039619, tz="EST"
我目前正在开发一个应用程序,当用户到达某个位置时,它会提醒用户。我希望这个应用程序也在后台运行并搜索解决方案。 在 AppStore 中,我发现了一款名为“Sleep Cycle”的应用程序,它可
我想创建一个基于 farbtastic color picker 的颜色选择器。我想要实现的是添加我想要链接到色轮的 RGB slider 。这是我到目前为止所拥有的。 app.controller(
RFC 5545 允许 RDATE 属性具有 PERIOD 数据类型。该数据类型的语义是什么?据我所知,这是未指定的。它会改变事件的持续时间吗?如果时区更改且没有持续时间怎么办? 最佳答案 尽管我
在 CodinGame学习平台,C# 教程中用作示例的问题之一是: The aim of this exercise is to check the presence of a number in a
我听说网上有一本英特尔书,它描述了特定汇编指令所需的 CPU 周期,但我找不到(经过努力)。谁能告诉我如何找到CPU周期? 这是一个例子,在下面的代码中,mov/lock 是 1 个 CPU 周期,x
据我所知,Java GC有次要GC(低成本)和主要GC周期(高成本)。如果对象在本地范围内,则会在 Minor GC 中清理它。如果对象的引用存储在代码中的其他位置,则它会在主 GC 中被清除。 例如
到目前为止,我有一个很好的自旋锁,可以用作 intendend: std::atomic_flag barrier = ATOMIC_FLAG_INIT; inline void lo
晚上好,我将 cycle2 与 prev 和 next 函数一起使用,但我无法将 prev 和 next 函数置于图像下方的中心。我环顾四周,我知道这会很愚蠢,但我就是看不到它。非常令人沮丧。谢谢加里
出于教育目的,我想知道在优化(在不同级别)和编译之后执行函数需要多少 CPU 周期。有没有办法分析代码或可执行文件以获得可重现的答案?我在 64 位 Windows 7 Pro 上使用 Eclipse
我想彻底测量和调整我的 C/C++ 代码,以便在 x86_64 系统上更好地使用缓存。我知道如何使用计数器(我的 Windows 机器上的 QueryPerformanceCounter)来测量时间,
我尝试将一些数据分组到每四周一次的存储桶中,并使用 pd.Grouper(key='created_at', freq='4W')。我希望这些组是这样的,如果我有从 2019-08-26 到 2019
我正在做一个关于随机数的大型学校项目,但我找不到 Math.random() 的句点。我安装了 7.0.800.15 版本,并且正在使用 Windows 10 计算机。我试过用一个简单的程序来确定周期
我正在努力解决我们生产环境中垃圾收集利用率高的问题,我想知道设置一个大的堆大小来保证老年代永远不会被填满是否会阻止触发主要的 GC 周期。 为了实现这一点,我想有一个特定的阈值标记会触发主要的 GC
我想测量在 Python 3 中执行加法运算所需的时钟周期数。 我写了一个程序来计算加法运算的平均值: from timeit import timeit def test(n): for i
我正在寻找一种方法来测量线程上的函数调用所花费的 cpu 周期。 示例伪代码: void HostFunction() { var startTick = CurrentThread.Cur
就 CPU 周期而言,malloc() 的成本是多少?(Vista/OS,最新版本的 gcc,最高优化级别,...) 基本上,我正在实现一个复杂的 DAG 结构(类似于链表)由一些 16B(不太常见)
C/C++ 中的类型转换会导致额外的 CPU 周期吗? 我的理解是,至少在某些情况下应该消耗额外的 CPU 周期。就像从浮点类型转换为整数一样,CPU 需要将浮点结构转换为整数。 float a=2.
我是一名优秀的程序员,十分优秀!