I tried to build the project Apache Knox 1.4.0 with hadoop 2.7.4
I did the build on a Ubuntu server :
- Ubtuntu 18.04
- Openjdk version "11.0.7"
- Apache Maven 3.6.0
- Apache Ant(TM) version 1.10.5
I have downloaded the src archive on http://www.apache.org/dyn/closer.cgi/knox/1.4.0/knox-1.4.0-src.zip
I get the following issue, and I'm looking for a solution :
/var/compil/knox/knox-1.4.0# mvn -Panalyze -Prelease clean install -DskipTests
[WARNING]
Dependency convergence error for org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15 paths to dependency are:
+-org.apache.knox:gateway-server:1.4.0
+-org.apache.hadoop:hadoop-auth:2.7.4
+-org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15
[WARNING]
Dependency convergence error for org.apache.directory.api:api-asn1-api:1.0.0-M20 paths to dependency are:
+-org.apache.knox:gateway-server:1.4.0
+-org.apache.hadoop:hadoop-auth:2.7.4
+-org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15
+-org.apache.directory.api:api-asn1-api:1.0.0-M20
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:30 min
[INFO] Finished at: 2020-05-14T11:20:57+02:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "analyze" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-dependencies) on project gateway-server: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
I want to set the variable spring.profiles.active in order to create a package from the command line accordingly, but I don't know how to do it
MacBook-Pro-de-nunito:tdk calzada$ export spring.profiles.active=war,pebloc
-bash: export: `spring.profiles.active=war,pebloc': not a valid identifier
I have also another one
MacBook-Pro-de-nunito:tdk calzada$ export APP-KEY=pebloc
-bash: export: `APP-KEY=pebloc': not a valid identifier
After trying the proposed solution, the active profiles are empty
MacBook-Pro-de-nunito:tdk calzada$ export SPRING_PROFILE_ACTIVE=war,sebloc
MacBook-Pro-de-nunito:tdk calzada$ mvn help:active-profiles
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.tdk:tdk:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-web:jar -> duplicate declaration of version (?) # line 70, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tdk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:active-profiles (default-cli) # tdk ---
[INFO]
Active Profiles for Project 'com.tdk:tdk:jar:0.0.1-SNAPSHOT':
The following profiles are active:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.491 s
[INFO] Finished at: 2017-03-15T19:23:01+01:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
Wouldn't be better to define this variables when you package the app. ?
mvn clean package -DskipTests -Dspring.profiles.active=pebloc,war -DAPP-KEY=pebloc
I will need your help please.
This is the context, I'm trying to set up a Continous Integration plateform, for specifc needs, and this is my Configuration, all in the same machine(Windows 7 ):
SonarQube 5.1 (I tried both internal and external databases)
SonarQube runner 2.4
PHP plugin for Sonar
Jenkins 1.6
SonarQube plugin for Jenkins (I'have already done all of the Sonarqube config in Jenkins)
I created a specific Job for PHP (Which is a local folder in my file system)(I configured the build section of Jenkins bu adding Standalone SonarQube Analysis, with the specific Path to projeetc proporties which point to my sonar-project.properties behind )
sonar.projectKey=my:project
sonar.projectName=PHP project analyzed with the SonarQube Runner reusing PHPUnit reports
sonar.projectVersion=1.0
sonar.sources=userthing,test sonar.tests=test sonar.language=php sonar.sourceEncoding=UTF-8 # Reusing PHPUnit reports #sonar.php.coverage.reportPath=reports/phpunit.coverage.xml #sonar.php.tests.reportPath=reports/phpunit.xml
When I launch a build from Jenkins I have this error :
NFO: Work directory: C:\Users\user\.jenkins\jobs\test projet\workspace\.sonar
INFO: SonarQube Server 5.1.2
14:13:10.295 INFO - Load global repositories
14:13:10.372 INFO - Load global repositories (done) | time=78ms
14:13:10.374 INFO - Server id: 20151028133512
14:13:10.374 INFO - User cache: C:\Users\user\.sonar\cache
14:13:10.379 INFO - Install plugins
14:13:10.706 INFO - Install JDBC driver
14:13:10.710 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
14:13:11.247 INFO - Initializing Hibernate
14:13:12.106 ERROR - Invalid value of sonar.tests for my:project
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2.131s
Final Memory: 6M/20M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: The folder 'test' does not exist for 'my:project' (base directory = C:\Users\user\.jenkins\jobs\test projet\workspace)
at org.sonar.batch.scan.ProjectReactorBuilder.checkExistenceOfPaths(ProjectReactorBuilder.java:427)
at org.sonar.batch.scan.ProjectReactorBuilder.validateDirectories(ProjectReactorBuilder.java:334)
at org.sonar.batch.scan.ProjectReactorBuilder.defineRootProject(ProjectReactorBuilder.java:163)
at org.sonar.batch.scan.ProjectReactorBuilder.execute(ProjectReactorBuilder.java:116)
at org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:110)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:86)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:90)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Lancer une analyse SonarQube autonome' marked build as failure
Finished: FAILURE
I follow those steps to identify the root concern:
I created manually sonar-project.properties.
Lunch sonar-runner.bat directly from my php folder, => then it works perfectly I have all the metric.
I'm sure that the root cause is Jenkins, but I don't know exactly what I'm missing.
Even if some times everything seems to work fine, I got this message from stacktrace
0 file indexed
:
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\DevTools\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\user\Desktop\Exemple de projet PHPUNIT\sonar-project.properties
INFO: Default locale: "fr_FR", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\user\.jenkins\jobs\projet\workspace\.sonar
INFO: SonarQube Server 5.1.2
14:55:20.977 INFO - Load global repositories
14:55:21.040 INFO - Load global repositories (done) | time=63ms
14:55:21.040 INFO - Server id: 20151028133512
14:55:21.040 INFO - User cache: C:\Users\user\.sonar\cache
14:55:21.040 INFO - Install plugins
14:55:21.390 INFO - Install JDBC driver
14:55:21.390 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
14:55:21.918 INFO - Initializing Hibernate
14:55:22.858 INFO - Load project repositories
14:55:23.030 INFO - Load project repositories (done) | time=172ms
14:55:23.030 INFO - Load project settings
14:55:23.326 INFO - Load technical debt model
14:55:23.358 INFO - Apply project exclusions
14:55:23.498 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
14:55:23.498 INFO - ------------- Scan My Sonar Analyses for PHP project
14:55:23.498 INFO - Load module settings
14:55:23.576 INFO - Language is forced to php
14:55:23.576 INFO - Load rules
14:55:23.864 INFO - Base dir: C:\Users\user\.jenkins\jobs\projet\workspace
14:55:23.864 INFO - Working dir: C:\Users\user\.jenkins\jobs\projet\workspace\.sonar
14:55:23.864 INFO - Source paths: .
14:55:23.864 INFO - Source encoding: UTF-8, default locale: fr_FR
14:55:23.864 INFO - Index files
14:55:23.866 INFO - **0 files indexed******************************
14:55:23.866 INFO - Quality profile for php: Sonar way
14:55:24.095 INFO - Sensor Lines Sensor
14:55:24.095 INFO - Sensor Lines Sensor (done) | time=0ms
14:55:24.095 INFO - Sensor QProfileSensor
14:55:24.105 INFO - Sensor QProfileSensor (done) | time=10ms
14:55:24.105 INFO - Sensor InitialOpenIssuesSensor
14:55:24.120 INFO - Sensor InitialOpenIssuesSensor (done) | time=15ms
14:55:24.120 INFO - Sensor ProjectLinksSensor
14:55:24.128 INFO - Sensor ProjectLinksSensor (done) | time=8ms
14:55:24.128 INFO - Sensor VersionEventsSensor
14:55:24.133 INFO - Sensor VersionEventsSensor (done) | time=5ms
14:55:24.133 INFO - Sensor SCM Sensor
14:55:24.133 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
14:55:24.133 INFO - Sensor SCM Sensor (done) | time=0ms
14:55:24.133 INFO - Sensor CPD Sensor
14:55:24.133 INFO - DefaultCpdEngine is used for php
14:55:24.133 INFO - Sensor CPD Sensor (done) | time=0ms
14:55:24.133 INFO - No quality gate is configured.
14:55:24.163 INFO - Compare to previous analysis (2015-10-28)
14:55:24.165 INFO - Compare over 30 days (2015-09-28, analysis of Wed Oct 28 14:39:55 CET 2015)
14:55:24.267 INFO - Execute decorators...
14:55:24.372 INFO - Store results in database
14:55:24.425 INFO - Analysis reports generated in 35ms, dir size=2 KB
14:55:24.435 INFO - Analysis reports compressed in 10ms, zip size=2 KB
14:55:24.459 INFO - Analysis reports sent to server in 23ms
14:55:24.460 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/projet
14:55:24.460 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 3.851s
Final Memory: 13M/113M
INFO: ------------------------------------------------------------------------
Finished: SUCCESS
It seems like his enable to index files that I have in my php folder.
Thanks in advance for your help!
I found the root cause, as I suggested in my last comment Jenkis is the root concern, because, I wasn't aware how Jenkins, build non source Controle Projects.
In fact you have to follow those steps in order to copy your projet into Jenkis workspace:
Build the Project at least once, (it will fail), but Jenkins will
create the structure jenkins/workspace/PROJECTNAME/
Copy the project files to jenkins/workspace/PROJECTNAME/
Build again and configure appropriately
For more information in the subject, I will suggest that you look jenkins docs:Builds for Non-Source Control Projects
I have grails project with CodeNarc Plugin installed and generated xml report. Installed and configured SonarQube with following configurations and versions:
Grails 2.3.7
SonarQube server- 4.5
SonarQube Runner- 2.4
CodeNarc Plugin- 0.22
Sonar-project.properties file contains
#sonar-runner.properties
sonar.projectKey=key
sonar.projectName=Project Name
sonar.projectVersion=1.0
sonar.sources=src, grails-app/services, grails-app/controllers, grails-app/domain
sonar.tests=test/
sonar.language=grvy
sonar.sourceEncoding=UTF-8
sonar.groovy.codenarc.reportPath=target/codenarc/codeNarcXMLReport.xml
Generated CodeNarc XML report and added its report path in file.
Sonar runner analyse project but with zero issues
Sonar runner unable to index resources and throws warning for CodeNarc rules violations.
SonarQube Runner 2.4
Java 1.7.0_21 Oracle Corporation (64-bit)
Linux 3.11.0-26-generic amd64
INFO: Runner configuration file: /media/Others/softwares/sonar-runner-2.4/conf/sonar-runner.properties
INFO: Project configuration file: /media/Others/repo/project/sonar-project.properties
INFO: Default locale: "en_IN", source code encoding: "UTF-8"
INFO: Work directory: /media/Others/repo/project/./.sonar
INFO: SonarQube Server 4.5
11:20:57.146 INFO - Load global referentials...
11:20:57.356 INFO - Load global referentials done: 213 ms
11:20:57.367 INFO - User cache: /home/.sonar/cache
11:20:57.378 INFO - Install plugins
11:20:57.680 INFO - Install JDBC driver
11:20:57.688 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
11:20:59.590 INFO - Initializing Hibernate
11:21:01.310 INFO - Load project referentials...
11:21:02.342 INFO - Load project referentials done: 1032 ms
11:21:02.342 INFO - Load project settings
11:21:03.193 INFO - Loading technical debt model...
11:21:03.218 INFO - Loading technical debt model done: 25 ms
11:21:03.222 INFO - Apply project exclusions
11:21:03.598 INFO - ------------- Scan project
11:21:03.603 INFO - Load module settings
11:21:04.228 INFO - Language is forced to grvy
11:21:04.230 INFO - Loading rules...
11:21:05.224 INFO - Loading rules done: 994 ms
11:21:05.260 INFO - Configure Maven plugins
11:21:05.537 INFO - Compare to previous analysis (2014-12-23)
11:21:05.557 INFO - Compare over 30 days (2014-11-23, analysis of 2014-11-10 17:20:47.0)
11:21:05.578 INFO - Compare to previous version (2014-10-30)
11:21:05.636 INFO - Loaded quality gate 'SonarQube way'
11:21:05.817 INFO - Base dir: /media/Others/repo/project/.
11:21:05.817 INFO - Working dir: /media/Others/repo/project/./.sonar
11:21:05.818 INFO - Source paths: src, grails-app/services, grails-app/controllers, grails-app/domain
11:21:05.818 INFO - Test paths: test
11:21:05.818 INFO - Source encoding: UTF-8, default locale: en_IN
11:21:05.818 INFO - Index files
11:21:06.276 INFO - 226 files indexed
11:21:44.020 INFO - Quality profile for grvy: Sonar way
11:21:44.404 INFO - Sensor QProfileSensor...
11:21:44.416 INFO - Sensor QProfileSensor done: 13 ms
11:21:44.416 INFO - Sensor CodeNarc...
11:21:44.593 WARN - No such rule in Sonar, so violation from CodeNarc will be ignored:
11:21:44.594 WARN - No such rule in Sonar, so violation from CodeNarc will be ignored:
11:21:44.595 WARN - No such rule in Sonar, so violation from CodeNarc will be ignored:
11:21:44.596 WARN - No such rule in Sonar, so violation from CodeNarc will be ignored:
11:21:44.599 WARN - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation#221
[resource=org.sonar.api.resources.File#4254e18d[key=<null>,deprecatedKey=grails-app/controllers/LoginController.groovy,path=<null>,
dir=grails-app/controllers,filename=LoginController.groovy,language=<null>],rule=Rule[id=427,name=Catch
Exception,key=org.codenarc.rule.exceptions.CatchExceptionRule,configKey=CatchException,plugin=grvy,severity=MINOR,isTemplate=false,status=READY,language=grvy,template=<null>],
message=The type Exception should not be caught,severity=<null>,lineId=93,cost=<null>,createdAt=<null>,switchedOff=false,
checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
11:21:44.602 WARN - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation#5e3666d9[resource=org.sonar.api.resources.File#459a60e1[key=<null>,
deprecatedKey=grails-app/controllers/LoginController.groovy,path=<null>,dir=grails-app/controllers,filename=LoginController.groovy,language=<null>],rule=Rule[id=431,name=Unused Method Parameter,key=org.codenarc.rule.unused.UnusedMethodParameterRule,configKey=UnusedMethodParameter,
plugin=grvy,severity=MINOR,isTemplate=false,status=READY,language=grvy,template=<null>],
message=Violation in class LoginController. Method parameter [newSignup] is never referenced in the method authComplete of class LoginController,severity=<null>,lineId=100,cost=<null>,createdAt=<null>,
switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
...
...
...
11:21:45.661 WARN - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation#6c95883d[resource=org.sonar.api.resources.File#4d23947c[key=<null>,deprecatedKey=test/unit/project/HomeControllerTests.groovy,
path=<null>,dir=test/unit/project,filename=HomeControllerTests.groovy,language=<null>],rule=Rule[id=643,name=Empty Method,key=org.codenarc.rule.basic.EmptyMethodRule,configKey=EmptyMethod,plugin=grvy,
severity=MINOR,isTemplate=false,status=READY,language=grvy,template=<null>],
message=Violation in class HomeControllerTests. The method tearDown is both empty and not marked with #Override,severity=<null>,lineId=121,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,
isNew=false,isManual=false,permanentId=<null>,personId=<null>]
11:21:45.661 INFO - Sensor CodeNarc done: 1245 ms
11:21:45.662 INFO - Sensor GroovySensor...
11:21:48.552 INFO - GMetrics completed: 1493ms
11:21:49.580 INFO - GMetrics completed: 941ms
11:21:51.285 INFO - GMetrics completed: 1601ms
11:21:51.561 INFO - GMetrics completed: 156ms
11:21:52.081 INFO - GMetrics completed: 488ms
11:21:52.167 INFO - Sensor GroovySensor done: 6505 ms
11:21:52.167 INFO - Sensor Groovy CoberturaSensor...
11:21:52.167 INFO - Analyzing Cobertura report: target/test-reports/cobertura/coverage.xml
11:21:52.955 INFO - Sensor Groovy CoberturaSensor done: 788 ms
11:21:52.956 INFO - Sensor ScmActivitySensor...
11:21:52.956 INFO - Trying to guess scm provider from project layout...
11:21:52.956 INFO - Found SCM type: git
11:21:52.958 INFO - Retrieve SCM blame information with encoding UTF-8...
11:21:55.580 INFO - Retrieve SCM blame information with encoding UTF-8 done: 2622 ms
11:21:55.581 INFO - Sensor ScmActivitySensor done: 2625 ms
11:21:55.585 INFO - Sensor InitialOpenIssuesSensor...
11:21:55.597 INFO - Sensor InitialOpenIssuesSensor done: 11 ms
11:21:55.597 INFO - Sensor ProjectLinksSensor...
11:21:55.607 INFO - Sensor ProjectLinksSensor done: 10 ms
11:21:55.608 INFO - Sensor VersionEventsSensor...
11:21:55.733 INFO - Sensor VersionEventsSensor done: 125 ms
11:21:55.733 INFO - Sensor FileHashSensor...
11:21:55.743 INFO - Sensor FileHashSensor done: 9 ms
11:21:55.743 INFO - Sensor CPD Sensor (wrapped)...
11:21:55.743 INFO - DefaultCpdEngine is used for grvy
11:21:55.751 INFO - Cross-project analysis disabled
11:21:56.330 INFO - Sensor CPD Sensor (wrapped) done: 587 ms
11:21:56.918 INFO - Execute decorators...
11:22:01.785 INFO - Store results in database
11:22:10.256 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/project
11:22:10.392 INFO - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
11:22:10.393 INFO - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
11:22:10.461 INFO - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
11:22:10.473 INFO - -> Keep one snapshot per day between 2014-11-25 and 2014-12-22
11:22:10.475 INFO - -> Keep one snapshot per week between 2013-12-24 and 2014-11-25
11:22:10.475 INFO - -> Keep one snapshot per month between 2009-12-29 and 2013-12-24
11:22:10.476 INFO - -> Delete data prior to: 2009-12-29
11:22:10.482 INFO - -> Clean project [id=225]
11:22:10.487 INFO - <- Clean snapshot 8702
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 1:15.303s
Final Memory: 26M/737M
INFO: ------------------------------------------------------------------------
I have installed all necessary plugins in SonarQube Server
After all configuration why these rules are getting ignored and zero issues generated for project ?
I have the same problem with getting ignored issues generated from codenarc report.
I found similar topic in sonarqube Nabble service that probably removing from codenarc report from path attributes every "grails-app/domain/", "grails-app/services/" etc. will resolve the problem, but this is only the source of the problem, there is nothing about how to do it automatically.
Below I attached the link to this post in the article.
http://sonarqube.15.x6.nabble.com/No-Issues-and-code-coverage-for-groovy-in-multi-language-project-with-SonarQube-4-2-tp5023761p5023806.html
We had this same problem. The issue surrounded SonarQube not being able to process violations in the CodeNarc report XML file. As shared in a previous answer, entries in the XML file that looks like the following:
...
<Package path='grails-app' totalFiles='54' filesWithViolations='46' priority1='10' priority2='92' priority3='610'/>
<Package path='grails-app/controllers' totalFiles='16' filesWithViolations='16' priority1='6' priority2='71' priority3='299'/>
<Package path='grails-app/controllers/com' totalFiles='16' filesWithViolations='16' priority1='6' priority2='71' priority3='299'/>
<Package path='grails-app/controllers/com/...' totalFiles='16' filesWithViolations='16' priority1='6' priority2='71' priority3='299'/>
...
will cause them to be ignored. As a work-around, we wrote a groovy script that strips out the "grails-app" and "grails-app/<folder>/" from the report file so that it looks like the following:
...
<Package path='com' totalFiles='16' filesWithViolations='16' priority1='6' priority2='71' priority3='299'/>
<Package path='com/...' totalFiles='16' filesWithViolations='16' priority1='6' priority2='71' priority3='299'/>
...
The script is run during our Jenkins builds after the report is generated and before the Sonar analysis is performed.
We are running SonarQube 4.5.1 (LTS) and using the version 1.0.1 of the Groovy plugin.
I have a problem with jenkins. It reports that the build of my symfony2 project ist successful, but directly after that it crashes with
ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception
java.io.EOFException: input contained no data
I have no clue why and I don't find any helpfull on the net for this error.
It apperead out of the blue. yesterday the build was done correctly.
here is my log:
jslint:
[exec] Result: 1
build:
BUILD SUCCESSFUL
Total time: 13 minutes 21 seconds
[CHECKSTYLE] Collecting checkstyle analysis files...
[CHECKSTYLE] Finding all files that match the pattern build/logs/checkstyle.xml
[CHECKSTYLE] Parsing 1 files in /var/lib/jenkins/jobs/DEVELOPMENT/workspace
[CHECKSTYLE] Successfully parsed file /var/lib/jenkins/jobs/DEVELOPMENT/workspace/build/logs/checkstyle.xml of module with 3 warnings.
[CHECKSTYLE] Computing warning deltas based on reference build #54
[DRY] Collecting duplicate code analysis files...
[DRY] Finding all files that match the pattern build/logs/pmd-cpd.xml
[DRY] Parsing 1 files in /var/lib/jenkins/jobs/DEVELOPMENT/workspace
[DRY] Successfully parsed file /var/lib/jenkins/jobs/DEVELOPMENT/workspace/build/logs/pmd-cpd.xml of module with 207 warnings.
[DRY] Computing warning deltas based on reference build #54
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing PHPUnit-3.x (default)
[xUnit] [INFO] - [PHPUnit-3.x (default)] - 1 test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/jobs/DEVELOPMENT/workspace' for the testing framework 'PHPUnit-3.x (default)'.
[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - Check 'Skipped Tests' threshold.
[xUnit] [INFO] - Setting the build status to SUCCESS
[xUnit] [INFO] - Stopping recording.
[JDepend] JDepend plugin is ready
[JDepend] Found 894 classes in 253 packages
ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception
java.io.EOFException: input contained no data
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at hudson.plugins.violations.parse.AbstractParser.expectNextTag(AbstractParser.java:262)
at hudson.plugins.violations.types.pmd.PMDParser.execute(PMDParser.java:39)
at hudson.plugins.violations.parse.AbstractTypeParser.parse(AbstractTypeParser.java:57)
at hudson.plugins.violations.ViolationsCollector.doType(ViolationsCollector.java:187)
at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:114)
at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:25)
at hudson.FilePath.act(FilePath.java:906)
at hudson.FilePath.act(FilePath.java:879)
at hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:74)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
As I see, the problem comes at a post-build action! Maybe, you don't have any data in the input file for JDepend, as I see from the error log. You must see if you give the correct path to the file and also, you must be sure that the file have some content... maybe the path is correct but the file is empty...