Upload of Sonar report fails - sonarqube5.6

I hava a platform based on sonarqube, when someone commit their java code ,it will trigger sonar scan committed files, use command like :
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.inclusions=/*test1.java,/*test2.java,**/*test3.java -Dsonar.projectKey=aaa -Dsonar.projectName=aaa -Dsonar.branch=aaa
sometimes it works fine, sometimes it get errors like below:
[INFO] Base dir: D:\GITMapping\Vendor.OrderSvc4j
[INFO] Working dir: D:\GITMapping\Vendor.OrderSvc4j\target\sonar
[INFO] Source encoding: UTF-8, default locale: zh_CN
[INFO] Sensor Lines Sensor
[INFO] Sensor Lines Sensor (done) | time=0ms
[INFO] Sensor SCM Sensor
[INFO] Sensor SCM Sensor (done) | time=0ms
[INFO] Sensor SonarJavaXmlFileSensor
[INFO] Sensor SonarJavaXmlFileSensor (done) | time=0ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=0ms
[INFO] Sensor Code Colorizer Sensor
[INFO] Sensor Code Colorizer Sensor (done) | time=0ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=0ms
[INFO] Calculating CPD for 1 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 181ms, dir size=525 KB
[INFO] Analysis reports compressed in 110ms, zip size=75 KB
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] vendor-ordersvc .................................... FAILURE [01:48 min]
[INFO] vendor-ordersvc-support ............................ SKIPPED
[INFO] vendor-ordersvc-dal ................................ SKIPPED
[INFO] vendor-ordersvc-contract ........................... SKIPPED
[INFO] vendor-ordersvc-ext ................................ SKIPPED
[INFO] vendor-ordersvc-agent .............................. SKIPPED
[INFO] vendor-ordersvc-cache .............................. SKIPPED
[INFO] vendor-ordersvc-biz ................................ SKIPPED
[INFO] vendor-ordersvc-soa ................................ SKIPPED
[INFO] vendor-ordersvc-client ............................. SKIPPED
[INFO] vendor-ordersvc-dotnet-client ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:49 min
[INFO] Finished at: 2018-01-11T18:55:04+08:00
[INFO] Final Memory: 108M/1585M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project vendor-ordersvc: Fail to request http://10.33.20.39:9000/api/ce/submit?projectKey=com.ctrip.tour:vendor-ordersvc&projectName=vendor-ordersvc&projectBranch=6c99fd81ee61f737b49cedfff2080c8ff5d65f45: Read timed out -> [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/MojoExecutionException

I solve this by add -Dsonar.ws.timeout=300 in scan command:
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.inclusions=/*test1.java,/*test2.java,**/*test3.java -Dsonar.projectKey=aaa -Dsonar.projectName=aaa -Dsonar.branch=aaa -Dsonar.ws.timeout=300

Try using this syntax :
mvn -b -U clean install sonar:sonar -Dsonar.host.url= -Dsonar.verbose=true Dsonar.scm.forceReloadAll=true
and then add your sonar parameters and connection to your pom.xml ofcourse.
in my case this syntax is always successful.
if it is still not working then my assumption is that your pom.xml is not set correctly.
good luck

Related

Packaging custom aws-java-sdk-bundle jar with maven

I am trying to customize the aws-java-sdk-bundle and packaging it with those modifications I made on my repo (specifically I modified the AmazonS3Client) . So far I have tried modifying the dependency in pom.xml to use the local aws-sdk jar instead of pulling it from maven:
--- a/aws-java-sdk-bundle/pom.xml
+++ b/aws-java-sdk-bundle/pom.xml
## -24,6 +24,8 ##
<artifactId>aws-java-sdk</artifactId>
<groupId>com.amazonaws</groupId>
<optional>false</optional>
+ <scope>system</scope>
+ <systemPath>${project.basedir}/../aws-java-sdk/target/aws-java-sdk-1.11.271.jar</systemPath>
<version>1.11.271</version>
</dependency>
</dependencies>
However, the result is that the bundle jar is empty. This is because as I realized, the aws-sdk is also empty if I try to package it:
$ mvn package -Dmaven.test.skip
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.amazonaws:aws-java-sdk >---------------------
[INFO] Building AWS SDK For Java 1.11.271
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # aws-java-sdk ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/ftx/aws-sdk-java/aws-java-sdk/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) # aws-java-sdk ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # aws-java-sdk ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) # aws-java-sdk ---
[INFO] Not compiling test sources
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) # aws-java-sdk ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # aws-java-sdk ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.339 s
[INFO] Finished at: 2021-12-06T01:36:25-08:00
[INFO] ------------------------------------------------------------------------
My question is: what is a recommended way on how to build the aws-sdk-bundle jar from local sources. (I want the bundle to contain my custom classes.)

Kurento tutorial does not run

I am trying to run the Kurento "WebRTC Magic Mirror" tutorial from the Linux Mint terminal, but get these errors.
mvn compile exec:java -Dkms.url=ws://(MY aws ip):8888/kurento
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Kurento Java Tutorial - Magic Mirror 6.7.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-java-version) # kurento-magic-mirror ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven-version) # kurento-magic-mirror ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-bytecode-version) # kurento-magic-mirror ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-ban-duplicate-classes) # kurento-magic-mirror ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message:
Duplicate classes found:
Found in:
org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
commons-logging:commons-logging:jar:1.1.3:compile
Duplicate classes:
org/apache/commons/logging/impl/SimpleLog$1.class
org/apache/commons/logging/LogConfigurationException.class
org/apache/commons/logging/Log.class
org/apache/commons/logging/impl/NoOpLog.class
org/apache/commons/logging/impl/SimpleLog.class
org/apache/commons/logging/LogFactory.class
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-ban-circular-dependencies) # kurento-magic-mirror ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-timestamp (get-build-timestamp) # kurento-magic-mirror ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (get-scm-revision) # kurento-magic-mirror ---
[INFO] Executing: /bin/sh -c cd '/home/jonado/kurento-tutorial-java/kurento-magic-mirror' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /home/jonado/kurento-tutorial-java/kurento-magic-mirror
[INFO] Storing buildNumber: a54263bde3275fc6e49db51be17268040df4e53d at timestamp: 1530780937453
[WARNING] Cannot get the branch information from the git repository:
Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref
[INFO] Executing: /bin/sh -c cd '/home/jonado/kurento-tutorial-java/kurento-magic-mirror' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /home/jonado/kurento-tutorial-java/kurento-magic-mirror
[INFO] Storing buildScmBranch: UNKNOWN
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # kurento-magic-mirror ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # kurento-magic-mirror ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/jonado/kurento-tutorial-java/kurento-magic-mirror/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.688 s
[INFO] Finished at: 2018-07-05T11:55:37+03:00
[INFO] Final Memory: 29M/599M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project kurento-magic-mirror: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [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/MojoFailureException
I have installed Kurento Media server on AWS as written in the documentation (part 4.1): https://media.readthedocs.org/pdf/doc-kurento/stable/doc-kurento.pdf , and after that just followed the instructions to run the tutorial.
The first warning message says:
JAVA_HOME environment variable is not set.
As Media Server is located on AWS, isn't it suppose to be already installed? If not, how can I install it?
Also, I wanted to configure STUN server, however I don't know where to find WebRtcEndpoint.conf.ini file, as Kurento Media Server is located on AWS. So, where is it possible to find WebRtcEndpoint.conf.ini file?
And the main question: what should I change/install/update in order to successfully run the tutorial?
You need to install the Java JDK to run any of the Java demos on your computer. The Java demo is separate from the Kurento Media Server, it uses the Java Kurento Client libraries to send/receive messages from the Kurento Media Server.
And in regards to WebRtcEndpoint.conf.ini, that is located on the AWS server where you deployed Kurento Media Server. You will need to edit the file (/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini) and restart Kurento for the changes to take effect. Related Kurento Config docs

JHipster Cloudfoundary throwing "Error uploading application" error

I am attempting to push my Jhipster app to cloud foundry using jhipster cloudfoundary command. Right at the end of the process it is throwing an error
Error uploading application.
GetFileAttributesEx C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\target\*.war: The filename, directory name or volume label syntax is incorrect.
Google is suggesting things like GetFileAttributesEx doesnt like special characters. I cant think what I could be doing to cause a file name syntax error. I tried deleting the target*.war files and re-compiling but no help. I am on Windows 8.1 64, with all updates applied.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006>yo jhipster:cloudfoundry
CloudFoundry configuration is starting
? Name to deploy as: modeldr006
? Which profile would you like to use? dev
? What is the name of your database service? cleardb
? What is the name of your database plan? spark
Creating Cloud Foundry deployment files
identical deploy\cloudfoundry\manifest.yml
Checking for an existing Cloud Foundry hosting environment...
Creating your Cloud Foundry hosting environment, this may take a couple minutes...
Creating the database
Creating service modeldr006 in org ModelDrivers / space development as greg.soulsby#ibpartners.co.uk...
OK
Building the application with the development profile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for us.modeldrivers.us:modeldr006:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.hateoas:spring-hateoas:jar -> duplicate declaration of version (?) # line
318, column 21
[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 modeldr006 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) # modeldr006 ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # modeldr006 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 22 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # modeldr006 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 115 source files to C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # modeldr006 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # modeldr006 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) # modeldr006 ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.4:war (default-war) # modeldr006 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [modeldr006] in [C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\target\modeldr006-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\src\main\webapp]
[INFO] Webapp assembled in [8576 msecs]
[INFO] Building war: C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\target\modeldr006-0.0.1-SNAPSHOT.war
[INFO]
[INFO] --- spring-boot-maven-plugin:1.1.9.RELEASE:repackage (default) # modeldr006 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30.544 s
[INFO] Finished at: 2014-11-26T18:16:04+00:00
[INFO] Final Memory: 44M/391M
[INFO] ------------------------------------------------------------------------
Pushing the application to Cloud Foundry
Using manifest file ./deploy/cloudfoundry/manifest.yml
Creating app modeldr006 in org ModelDrivers / space development as greg.soulsby#ibpartners.co.uk...
OK
Using route modeldr006.cfapps.io
Binding modeldr006.cfapps.io to modeldr006...
OK
Uploading modeldr006...
FAILED
Error uploading application.
GetFileAttributesEx C:\IBP\03_Product\modelDR\03_Product\01_Jhipster\modeldr006\target\*.war: The filename, directory name or volume label syntax is incorrect.
× { [Error: Command failed: ] killed: false, code: 1, signal: null }

mule-Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.5.9:wsdl2java (default) on project : javax/xml/ws/Action

I'm following http://www.mulesoft.org/documentation... to create a connector to a SOAP Service via CXF Client Example. When I add the required maven dependency code in ,pom file and clean and run it(on mule studio)...I'm getting the following error :
Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.5.9:wsdl2java (default) on project sunsetriseconnector: javax/xml/ws/Action
The full stack trace looks like this :
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Sunset Sunrise Service 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> studio-maven-plugin:3.4.2:studio (default-cli) # sunsetriseconnector >>>
[INFO]
[INFO] --- mule-devkit-maven-plugin:3.4.0:attach-test-resources (default-attach-test-resources) # sunsetriseconnector ---
[INFO] Attaching test resource D:\MuleExamples\sunsetrise\src\main\app
[INFO]
[INFO] --- maven-enforcer-plugin:1.0-alpha-4:enforce (enforce-maven-version) # sunsetriseconnector ---
[INFO]
[INFO] --- mule-devkit-maven-plugin:3.4.0:generate-sources (default-generate-sources) # sunsetriseconnector ---
[INFO] Source directory: D:\MuleExamples\sunsetrise\target\generated-sources\mule added
[INFO] Resource directory: D:\MuleExamples\sunsetrise\target\generated-sources\mule added
[INFO] Sorting generator executing based on their dependencies...
[INFO] Searching for classes annotated with #Connector
[INFO] Validating sunsetriseConnector class
[INFO] Validating Multi-module consistency
[INFO] Adding registry bootstrap entry for org.tutorial.sunsetrise.agents.DefaultSplashScreenAgent as DefaultSplashScreenAgent
[INFO] Generating message processor as org.tutorial.sunsetrise.processors.MyProcessorMessageProcessor for method myProcessor in sunsetriseConnector
[INFO] Generating config element definition parser as org.tutorial.sunsetrise.config.sunsetriseConnectorConfigDefinitionParser for class sunsetriseConnector
[INFO] Generating bean definition parser as org.tutorial.sunsetrise.config.MyProcessorDefinitionParser for message processor org.tutorial.sunsetrise.processors.MyProcessorMessageProcessor
[INFO] Validating example for method: myProcessor
log4j:WARN No appenders could be found for logger (org.springframework.beans.factory.xml.PluggableSchemaResolver).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO]
[INFO] --- cxf-codegen-plugin:2.5.9:wsdl2java (default) # sunsetriseconnector ---
May 2, 2014 12:18:13 PM org.apache.cxf.xjc.bg.BooleanGetterPlugin run
INFO: Running boolean getter plugin.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.464s
[INFO] Finished at: Fri May 02 12:18:13 IST 2014
[INFO] Final Memory: 33M/62M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.5.9:wsdl2java (default) on project sunsetriseconnector: javax/xml/ws/Action -> [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/MojoExecutionException
I'm pretty new in mule and also in Apache cxf. Please help me.
Thanks.
I got the fix by adding jaxws-api-2.2.1.jar inside C:\Program Files (x86)\Java\jdk1.6.0_02\jre\lib\endorsed folder.
If you're using MuleStudio, which is built on Eclipse, you should import the JAR into your build path. See This SO answer
If you're using Mule ESB Standalone, you should drop the JAR into the MULE_HOME/apps/yourapp/lib directory if you need it on a per-app basis, or in the /MULE_HOME/lib/user
See the class loader documentation

Uable to build WSO2 API Mngt 4.0.7

When i am trying to build wso2 api mgnt i got this error: Please help me
mvn clean install
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15:22.482s
[INFO] Finished at: Wed Apr 24 15:02:05 IST 2013
[INFO] Final Memory: 19M/490M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wso2.maven:carbon-p2-plugin:1.5:p2-profile-gen
(3-p2-profile-generation) on project am-p2-profile: P2 publisher return code was 13 -> [
First you have to build orbit then kernal and after that the platform. Have you done that order. If you get the same error can you paste full error log.
Thanks !