Sonarqube jenkins integration - maven

I am triyng to intergate jenkins and maven with sonarqube.
I am completed with prerequistes and installation part
there is ome error related to class not loading, i am confused what is the reason behind this.
JENKINS PIPELINE
stage('Test & code quality check ') {
withMaven(maven: 'M3'){
withSonarQubeEnv(credentialsId:'mbk-sonar',installationName:'sonar-qube') {
sh '''mvn sonar:sonar -X -f /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/pom.xml \
-Dsonar.projectKey=mobikwik-jenkins \
-Dsonar.projectName=mobikwik-jenkins \
-Dsonar.host.url=https://sonar.mobikwik.com\ /
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.language=java \
-Dsonar.sources=/var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/shared-objects/src/main/ \
-Dsonar.java.binaries=/opt/sonarqube/web/WEB-INF/classes'''
}
}
}
JENKINS CONSOLE OUTPUT- [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project root: Unable to load component class org.sonar.scanner.report.MetadataPublisher: Unable to load component class
Injecting SonarQube environment variables using the configuration: sonar-qube
[Pipeline] {
[Pipeline] sh
+ mvn sonar:sonar -X -f /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/pom.xml -Dsonar.projectKey=mobikwik-jenkins -Dsonar.projectName=mobikwik-jenkins -Dsonar.host.url=http://10.20.15.26:9000 -Dsonar.sourceEncoding=UTF-8 -Dsonar.language=java -Dsonar.sources=/var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/shared-objects/src/main/ -Dsonar.java.binaries=/opt/sonarqube/web/WEB-INF/classes
----- withMaven Wrapper script -----
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd"
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/M3
Java version: 1.8.0_222, vendor: Oracle Corporation, runtime: /usr/local/openjdk-8/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.9.0-11-amd64", arch: "amd64", family: "unix"
[DEBUG] Included /var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd/pipeline-maven-spy.jar
[DEBUG] Populating class realm maven.ext
[DEBUG] Included /var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd/pipeline-maven-spy.jar
[INFO] [jenkins-event-spy] Generate /var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd/maven-spy-20200912-110023-7696240343729296116878.log.tmp ...
[INFO] 11:00:26.484 Project key: mobikwik-jenkins
[INFO] 11:00:26.485 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc
[INFO] 11:00:26.485 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/target/sonar
[DEBUG] 11:00:26.486 Project global encoding: UTF-8, default locale: en
[DEBUG] 11:00:26.488 Creating module hierarchy
[DEBUG] 11:00:26.488 Init module 'mobikwik-jenkins'
[DEBUG] 11:00:26.489 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc
[DEBUG] 11:00:26.489 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/target/sonar
[DEBUG] 11:00:26.490 Module global encoding: UTF-8, default locale: en
[DEBUG] 11:00:26.490 Init module 'mobikwik-jenkins'
[DEBUG] 11:00:26.490 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/cabs-api
[DEBUG] 11:00:26.491 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/cabs-api/target/sonar
[DEBUG] 11:00:26.491 Module global encoding: UTF-8, default locale: en
[DEBUG] 11:00:26.492 Init module 'mobikwik-jenkins'
[DEBUG] 11:00:26.492 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/core
[DEBUG] 11:00:26.492 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/core/target/sonar
[DEBUG] 11:00:26.493 Module global encoding: UTF-8, default locale: en
[DEBUG] 11:00:26.493 Init module 'mobikwik-jenkins'
[DEBUG] 11:00:26.494 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/shared-objects
[DEBUG] 11:00:26.494 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/shared-objects/target/sonar
[DEBUG] 11:00:26.495 Module global encoding: UTF-8, default locale: en
[DEBUG] 11:00:26.495 Init module 'mobikwik-jenkins'
[DEBUG] 11:00:26.495 Base dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/mbk-service
[DEBUG] 11:00:26.496 Working dir: /var/jenkins_home/workspace/cabs-stag/cabs-stagSrc/mbk-service/target/sonar
[DEBUG] 11:00:26.496 Module global encoding: UTF-8, default locale: en
[INFO] 11:00:26.501 Load project settings for component key: 'mobikwik-jenkins'
[DEBUG] 11:00:26.522 GET 200 api/settings/values.protobuf?component=mobikwik-jenkins | time=20ms
[INFO] 11:00:26.523 Load project settings for component key: 'mobikwik-jenkins' (done) | time=22ms
[DEBUG] 11:00:26.530 No language available
[INFO] 11:00:26.537 Load quality profiles
[DEBUG] 11:00:26.550 GET 200 http://10.20.15.26:9000/api/qualityprofiles/search.protobuf?project=mobikwik-jenkins | time=12ms
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for root 1.6.0-SNAPSHOT:
[INFO]
[INFO] root ............................................... FAILURE [ 2.222 s]
[INFO] shared-objects ..................................... SKIPPED
[INFO] core ............................................... SKIPPED
[INFO] mbk-service ........................................ SKIPPED
[INFO] cabs-api ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.638 s
[INFO] Finished at: 2020-09-12T11:00:26Z
[INFO] ------------------------------------------------------------------------
[INFO] [jenkins-event-spy] Generated /var/jenkins_home/workspace/cabs-stag#tmp/withMaven42e8b7cd/maven-spy-20200912-110023-7696240343729296116878.log
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project root: Unable to load component class org.sonar.scanner.report.MetadataPublisher: Unable to load component class org.sonar.scanner.rule.QualityProfiles: No quality profiles have been found, you probably don't have any language plugin installed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project root: Unable to load component class org.sonar.scanner.report.MetadataPublisher
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
Caused by: org.sonar.api.utils.MessageException: No quality profiles have been found, you probably don't have any language plugin installed.
[ERROR]
[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
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[withMaven] Jenkins Task Scanner Plugin not found, don't display results of source code scanning for 'TODO' and 'FIXME' in pipeline screen.
[withMaven] Publishers: Pipeline Graph Publisher: 2 ms, Dependencies Fingerprint Publisher: 68 ms, Open Task Scanner Publisher: 1 ms

It appears you have not installed any language plugins in SonarQube (not Jenkins).
org.sonar.scanner.rule.QualityProfiles: No quality profiles have been found, you probably don't have any language plugin installed. -> [Help 1]
As a SonarQube Admin, log into SonarQube. From the main menu, Administration | Marketplace ..., filter on "Languages" for Sonar provided languages, "External Analyzers" for third party. "Install" as necessary, Restart required.
As of 7.X, SQ will analyze all code for which a language analyzer is installed; language=java is ignored.

Related

Jenkins pipeline spring boot application not building

jenkinspipeline is unable to build the springboot application
`+ mvn -f EquipOptimizationApi/AddNewEquipment/pom.xml install
----- withMaven Wrapper script -----
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/lib/jenkins/workspace/addNewEquip#tmp/withMaven2d5b8b4d/pipeline-maven-spy.jar"
-Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/lib/jenkins/workspace/addNewEquip#tmp/withMaven2d5b8b4d"
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Maven home: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven
Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.amzn2.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.14.47-64.38.amzn2.x86_64", arch: "amd64", family: "unix"
[INFO] [jenkins-event-spy] Generate /var/lib/jenkins/workspace/addNewEquip#tmp/withMaven2d5b8b4d/maven-spy-20180718-135754-559519187898694815320.log.tmp
...
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.miss:AddNewEquipment >----------------------
[INFO] Building AddNewEquipment 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AddNewEquipment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # AddNewEquipment ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 13 source files to /var/lib/jenkins/workspace/addNewEquip/EquipOptimizationApi/AddNewEquipment/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.893 s
[INFO] Finished at: 2018-07-18T13:57:57Z
[INFO] ------------------------------------------------------------------------
[INFO] [jenkins-event-spy] Generated /var/lib/jenkins/workspace/addNewEquip#tmp/withMaven2d5b8b4d/maven-spy-20180718-135754-559519187898694815320.log
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project AddNewEquipment: 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
[Pipeline] }
[withMaven] Jenkins Task Scanner Plugin not found, don't display results of source code scanning for 'TODO' and 'FIXME' in
pipeline screen.
[Pipeline] // withMaven
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE`
In your pipeline, you have to declare the jdk.
You have to configure tool jdk in global tools administration.
Example:
pipeline {
tools {
jdk 'openjdk-1.8'
maven 'Maven_3_5_2'
}
stages {
stage('Build') {
steps {
echo 'Building..'
sh "mvn clean install"
}
}
}
}
You can also modify JAVA_HOME localy to the node.
node {
jdk = tool name: 'JDK17'
env.JAVA_HOME = "${jdk}"
echo "jdk installation path is: ${jdk}"
// next 2 are equivalents
sh "${jdk}/bin/java -version"
// note that simple quote strings are not evaluated by Groovy
// substitution is done by shell script using environment
sh '$JAVA_HOME/bin/java -version'
}
src: https://support.cloudbees.com/hc/en-us/articles/115001595227-How-To-Specify-A-Specific-JDK-In-Pipeline-

Jenkins build error for a maven test project on ubuntu 16.04

I am encountering the error below while running a maven test project on Ubuntu 16.04. When I run the project from the terminal it works fine. But I need to run it through Jenkins now.
I have given all permissions for jenkins user. I cannot seem to understand the reason for this error so that I can troubleshoot further. Can someone please help as I am new to Devops and learning?
Console Output
`EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/Maven Test Parsing POMs Established TCP socket on 43944 [IceScrum] $ /usr/lib/jvm/java-8-oracle //bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-agent-1.12-alpha-1.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/share/maven/conf/logging jenkins.maven3.agent.Maven33Main /usr/share/maven/ /var/cache/jenkins/war/WEB-INF/lib/remoting-3.10.2.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-interceptor-1.12-alpha-1.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 43944 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f /opt/IceScrum/pom.xml verify [INFO] Scanning for projects...`
`[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) # cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) # cxm7 --- [INFO] No tests to run.
[INFO] Surefire report directory: /opt/IceScrum/target/surefire-reports`
`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project cxm7: Error creating properties files for forking: Permission denied -> [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.
[JENKINS] Archiving /opt/IceScrum/pom.xml to cxm/cxm7/0.0.1-SNAPSHOT/cxm7-0.0.1-SNAPSHOT.pom
/opt/IceScrum/pom.xml is not inside /var/lib/jenkins/workspace/Maven Test/opt/IceScrum/; will archive in a separate pass [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
channel stopped
Finished: FAILURE`
After I ran the script with -X switch. I got the following results.
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-101-generic", arch: "amd64", family: "unix"
[DEBUG] Populating class realm maven.api [INFO] Error stacktraces are turned on.[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml [DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml[DEBUG] Reading user toolchains from /root/.m2/toolchains.xml [DEBUG] Using local repository at /root/.m2/repository [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository [INFO] Scanning for projects
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none) [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null] [INFO]``[INFO] BUILD FAILURE``[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory. -> [Help 1]org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:84)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[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/MissingProjectException

Running mvn -pl Setup exec:exec gives error

After running mvn clean install, when I try to run mvn -pl setup exec:exec I get the following error:
[INFO] Scanning for projects... [INFO] [INFO]
------------------------------------------------------------------------ [INFO] Building sikulixsetup 1.1.1 [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.3.1:exec (default-cli) #
sikulixsetup --- [debug] RunTimeINIT: global init: entering as:
SETUP [debug] RunTimeINIT: ScreenDevice 0 has (0,0) --- will be
primary Screen(0) [debug] RunTimeINIT: Monitor 0: (0, 0) 1600 x
900 [debug] RunTimeINIT: runs as sikulixsetup-1.1.1-forsetup.jar
in:
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup\target
[debug] RunTimeINIT: folder target detected - supposing Maven
project: C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master
***** show environment for SETUP (build 201605140512) user.home: C:\Users\bhowmik user.dir (work dir):
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup
user.name: bhowmik java.io.tmpdir: C:\Users\bhowmik\AppData\Local\Temp
running 64Bit on Windows (6.1) in Maven project from some jar java
8-64 version 1.8.0_91-b14 vm 25.91-b14 class 52.0 arch amd64 app data
folder: C:\Users\bhowmik\AppData\Roaming\Sikulix libs folder: null
executing jar:
C:\Users\bhowmik\Downloads\TEST_NIGHTLY\SikuliX-2014-master\Setup\target\sikulixsetup-1.1.1-forsetup.jar
* classpath dump sikulix 0: /C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar
* classpath dump end
***** show environment end [debug] RunTimeSETUP: global init: leaving [debug] RunTimeSETUP: initAPI: entering [debug]
RunTimeSETUP: resourceList: enter [debug] RunTimeSETUP:
resourceLocation: (class org.sikuli.setup.RunSetup) /Lib/sikuli
[debug] RunTimeSETUP: resourceList: having jar:
jar:file:/C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar!/Lib/sikuli
[debug] RunTimeSETUP: files exported: 7 from: Lib/sikuli to:
C:\Users\bhowmik\AppData\Roaming\Sikulix\Lib\sikuli [debug]
RunTimeSETUP: initAPI: leaving [debug] RunTimeSETUP: exists libs
folder at:
C:\Users\bhowmik\AppData\Roaming\Sikulix\SikulixLibs_201605140512
[debug] RunTimeSETUP: libs folder empty or has wrong content
[debug] RunTimeSETUP: now exporting libs
* classpath dump 0: /C:/Users/bhowmik/Downloads/TEST_NIGHTLY/SikuliX-2014-master/Setup/target/sikulixsetup-1.1.1-forsetup.jar
* classpath dump end [error] RunTimeSETUP: *** terminating: libs to export not found on above classpath:
/sikulixlibs/windows/libs64 [debug] RunTimeSETUP: final cleanup
[debug] FileManager: deleteFileOrFolder:
C:\Users\bhowmik\AppData\Local\Temp\Sikulix_387398274 [INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 3.279 s [INFO] Finished at:
2016-05-14T11:10:34+05:30 [INFO] Final Memory: 13M/153M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec (default-cli) on
project sikulixsetup: Command execution failed. Process exited with an
error: 1 (Exit value: 1) -> [Help 1 ]

Javac does not compile classes to target folder

YES I did mvn clean.
Tried in Maven 3.1.0, 3.0.4 and 3.0.3
My multi-module maven project's build (mvn install) fails at some module. The cause is that the last module was built with SUCCESS, but in fact the jar is empty. And then the next module can't find the classes that it needs to see.
[INFO] Reactor Summary:
[INFO]
[INFO] myproject ......................................... SUCCESS [0.309s]
[INFO] myproject-service ................................. SUCCESS [0.011s]
[INFO] myproject-service-api ............................ SUCCESS [1.242s]
[INFO] myproject-service-spi ............................ FAILURE [1.422s]
[INFO] myproject-datap-lib-impl .................. SKIPPED
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.746s
[INFO] Finished at: Wed Jul 24 17:30:57 EEST 2013
[INFO] Final Memory: 62M/919M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project myproject-service-spi: Compilation failure: Compilation failure:
[ERROR] C:\dev\mything\myproject\trunk-checkout2\service\spi\src\main\java\org\myself\service\spi\validation\fake\AbstractConfigurableFakeDetector.java:[12,55] error: package org.myself.service.validation.fake does not exist
Here is the complete debug output from running mvn -X clean install -amd -Dmaven.test.skip=true > build.log http://nopaste.info/7f07571993.html
In IntelliJ IDEA it all looks good, the class exists.
Not just the generated jar is empty, also the folder service/api/target/classes.
My pom file for service-api is very basic, just like the others that work:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>myparent</artifactId>
<groupId>my.parent</groupId>
<version>myversion</version>
</parent>
<groupId>myproject.service.api</groupId>
<artifactId>myproject-service-api</artifactId>
<dependencies>
... some local and external dependencies
</dependencies>
<properties>
</properties>
</project>
No maven plugins here.
I don't think I have a cyclic dependency, because Maven 3 would detect this.
UPDATE
I've now got it down to this: a simple mvn compile on the module that creates the empty jar gives me this output in IntelliJ IDEA:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myproject-service-api 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # myproject-service-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\myproject\trunk-checkout2\service\api\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # myproject-service-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 217 source files to C:\myproject\trunk-checkout2\service\api\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.908s
[INFO] Finished at: Wed Jul 24 21:56:49 EEST 2013
[INFO] Final Memory: 20M/232M
[INFO] ------------------------------------------------------------------------
And right after running that, the folder C:\myproject\trunk-checkout2\service\api\target\classes is empty. So the 217 Java classes are detected, maven says it compiles them and puts them into my target folder, but it does not.
Update 2
I've compared the output of mvn -X compile of a module that works compared to this one (remember, all end in BUILD SUCCESS but this one has an empty target folder). There is a difference: the failing one lists all java files as "Stale source detected".
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [C:\myproject\trunk-checkout2\service\api\src\main\java]
[DEBUG] Classpath: [C:\myproject\trunk-checkout2\service\api\target\classes
... all the dependency jars
[DEBUG] Output directory: C:\myproject\trunk-checkout2\service\api\target\classes
[DEBUG] CompilerReuseStrategy: reuseCreated
[DEBUG] useIncrementalCompilation enabled
[DEBUG] Stale source detected: C:\dev\myproject\trunk-checkout2\service\api\src\main\java\my\Class.java
... listing all 217 classes
[INFO] Changes detected - recompiling the module!
[DEBUG] Classpath:
[DEBUG] C:\myproject\trunk-checkout2\service\api\target\classes
... all the dependency jars
[DEBUG] Source roots:
[DEBUG] C:\myproject\trunk-checkout2\service\api\src\main\java
[DEBUG] Command line options:
[DEBUG] -d (...) -g -nowarn -target 1.6 -source 1.6 -encoding UTF-8
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 217 source files to C:\myproject\trunk-checkout2\service\api\target\classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.060s
[INFO] Finished at: Wed Jul 24 23:16:37 EEST 2013
[INFO] Final Memory: 22M/328M
[INFO] ------------------------------------------------------------------------
I've seen this bug report https://jira.codehaus.org/browse/MCOMPILER-205 and I do have package-info.java files in this module, but I've tried a pre-3 compiler plugin, same result. And I've tried with an annotation as described there, no luck either. So I don't think it's the same case.
I don't have a public static void main, thus this bug Workaround for javac compilation order bug in maven can't be it.
UPDATE 3
There's an abort in javac, without notice (-verbose turned on). Just 1 class works, all 217 fails. So I guess I have to try to find which causes it, etc... will post again.
First in your log output there are several hints about things like ${version} which you should fix furthermore there are other warnings about duplicate definitions of dependencies etc.
I have taken a deeper look into the log output:
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespivalidationfakeAbstractConfigurableFakeDetector.java:[12,55] error: package org.myself.service.validation.fake does not exist
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespivalidationfakeAbstractConfigurableFakeDetector.java:[13,55] error: package org.myself.service.validation.fake does not exist
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespivalidationfakeAbstractConfigurableFakeDetector.java:[82,14] error: cannot find symbol
[ERROR] symbol: class SimpleValidationResult
location: class AbstractConfigurableFakeDetector
C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespivalidationfakeAbstractConfigurableFakeDetector.java:[106,66] error: cannot find symbol
[ERROR] symbol: class FakeType
location: class AbstractConfigurableFakeDetector
C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespivalidationfakeAbstractConfigurableFakeDetector.java:[97,8] error: cannot find symbol
[ERROR] symbol: class SimpleValidationResult
location: interface SomethingThatReturnsValidationResult
C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespigenderresultAverageComputedGenderResultCollector.java:[4,46] error: package org.myself.service.gender does not exist
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespigenderresultAverageComputedGenderResultCollector.java:[5,46] error: package org.myself.service.gender does not exist
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespigenderresultAbstractAverageGenderCollector.java:[4,46] error: package org.myself.service.gender does not exist
[ERROR] C:devmythingmyprojecttrunk-checkout2servicespisrcmainjavaorgmyselfservicespigenderresultAverageComputedGenderResultCollector.java:[31,29] error: cannot find symbol
[ERROR] symbol: class ComputedGenderResult
location: class AverageComputedGenderResultCollector
which gives me the impression that you are using test classes or may be package names from the test area which will not work or you are missing a dependency to an other package.
The cause was due to a bug in javac. Some valid syntax it could not handle. That then generated the empty jar, and so on.

Maven execution of test not working

Hi everybody i'm actually using Jenkins and testlink (with testLink Plugin) to make test automation.
I am not familiar with IC and testlink so i try to take a good start with the "TestLink Plug-in Tutorial".
But when I run a build I am getting following error:
[workspace] $ C:\maven-3.0.4\bin\mvn.bat -s C:\maven-3.0.4\conf\settings.xml -gs C:\maven- 3.0.4\conf\settings.xml clean test -DsuiteXmlFiles=suite.xml
[INFO] ---------------------------------------------------------------------
[INFO] Building Jenkins TestLink Plug-in Tutorial 0.3-SNAPSHOT
[INFO] ---------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # jenkins-testlink-plugin- tutorial ------------------------------------------------------------
[INFO] Deleting C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target
[INFO]
[INFO] --- docbkx-maven-plugin:2.0.11:generate-pdf (book-output) # jenkins-testlink-plugin-tutorial ---
[INFO] Processing input file: book.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.377s
[INFO] Finished at: Tue Feb 19 17:43:14 CET 2013
[INFO] Final Memory: 8M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output) on project jenkins-testlink-plugin-tutorial: Failed to read source: Connection timed out: connect -> [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 am using a proxy defined in my settings.xml in maven/conf .
I think that maven can't reach the goal test when it is generating the pdf.
I googled a lot but nothing of really usefull, can someone help me plz?
Okay thanks for this first advice! I don't know what is the use of this commande -DsuiteXmlFiles=suite.xml but no changes without it. With the -X i've got this :
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<artifacts>${plugin.artifacts}</artifacts>
<draftMode>no</draftMode>
<foCustomization>src/main/book/stylesheets/style.xsl</foCustomization>
<fop1Extensions>1</fop1Extensions>
<generatedSourceDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target/book/generated/en</generatedSourceDirectory>
<highlightSource>1</highlightSource>
<includes default-value="*.xml">book.xml</includes>
<postProcess>
<copy todir="C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/target/book/media">
<fileset dir="C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/src/main/book/media/">
<include name="**/*.css"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
</postProcess>
<project>${project}</project>
<sourceDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/src/main/book/en/</sourceDirectory>
<targetDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target/book/en/</targetDirectory>
<targetFileExtension default-value="fo"/>
<xincludeSupported>true</xincludeSupported>
</configuration>
and this :
[DEBUG] (f) draftMode = no
[DEBUG] (f) foCustomization = src/main/book/stylesheets/style.xsl
[DEBUG] (f) fop1Extensions = 1
[DEBUG] (f) generatedSourceDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\generated\en
[DEBUG] (f) highlightSource = 1
[DEBUG] (f) includes = book.xml
[DEBUG] (f) postProcess =
[DEBUG] (f) project = MavenProject: com.tupilabs:jenkins-testlink-plugin-tutorial:0.3-SNAPSHOT # C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\pom.xml
[DEBUG] (f) sourceDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\src\main\book\en
[DEBUG] (f) targetDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\en
[DEBUG] (f) targetFileExtension = fo
[DEBUG] (f) xincludeSupported = true
[DEBUG] -- end configuration --
[DEBUG] Catalogs to load: jar:file:/C:/Users/rlyonnet/.m2/repository/net/sf/docbook/docbook-xsl/1.75.2/docbook-xsl-1.75.2-ns-resources.zip!/docbook/catalog.xml
[DEBUG] Using stylesheet: jar:file:/C:/Users/rlyonnet/.m2/repository/net/sf/docbook/docbook-xsl/1.75.2/docbook-xsl-1.75.2-ns-resources.zip!/docbook/fo/docbook.xsl
[DEBUG] SourceFile: C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\src\main\book\en\book.xml
[DEBUG] TargetFile: C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\en\book.fo
[INFO] Processing input file: book.xml
[DEBUG] Advanced XInclude mode entered
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.450s
[INFO] Finished at: Wed Feb 20 09:23:37 CET 2013
[INFO] Final Memory: 7M/76M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output) on project jenkins-testlink-plugin-tutorial: Failed to read source: Connection timed out: connect -> [Help 1]

Resources