AW: Cobertura Maven Plugin works locally, but not in Jenkins
Good morning Olivier, Stephen and John, thanks for your replies. It seems that I really had different Java's: Local: > Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) > Maven home: C:\Program Files\Java\apache-maven-3.0.4 > Java version: 1.8.0_92, vendor: Oracle Corporation > Java home: C:\Program Files\Java\jdk1.8.0_92\jre > Default locale: de_DE, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos" Jenkins: > Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) > Maven home: C:\Java\Maven\apache-maven-3.0.4 > Java version: 1.8.0_92, vendor: Oracle Corporation > Java home: C:\Program Files\Java\jre1.8.0_92 > Default locale: de_DE, platform encoding: Cp1252 > OS name: "windows server 2008 r2", version: "6.1", arch: "amd64", family: > "dos" In the Jenkins job there was no Java explicitly set. So I did that. I also deleted the local Maven repository on the Jenkins machine. After that the same Java was used and everything worked fine. Thanks again for your thoughts on my problem. :-) Regards, Gerrit -Ursprüngliche Nachricht- Von: Olivier Lamy [mailto:ol...@apache.org] Gesendet: Mittwoch, 13. Juli 2016 01:53 An: Maven Users List Betreff: Re: Cobertura Maven Plugin works locally, but not in Jenkins Hi Do you have a sample project to reproduce the issue? On Wednesday, 13 July 2016, Hohl, Gerrit wrote: > Hello everyone, > > > > I faced an odd problem today: > > We have a Maven Build which also includes the creation of a > documentation. > > One of the plugins creating the reports is the Cobertura Maven Plugin. > > If I execute it on my local machine it works perfectly. > > Also the project has no code at all (it's more an Ant and aggregation > project) it creates the documentation and also deploys it. > > > > But if I try to build the same project in our Jenkins build service > the Maven jobs just days while trying to execute the Cobertura Maven Plugin. > > I added --debug, but also if the debug messages are enabled I don't > see an error, stack trace or whatever in the log. > > On my local machine the output looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [DEBUG] Created new class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Importing foreign packages into class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Imported: < maven.api > > [DEBUG] Imported: org.apache.maven.doxia.logging.Log < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [DEBUG] Imported: org.apache.maven.doxia.logging.LogEnabled < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [...] > > > > The output with the Jenkins server looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [JENKINS] Archiving site from c:\jenkins_data\workspace\target\site to > C:\.jenkins\jobs\xxx\site > > > > Jul 12, 2016 3:43:15 PM > org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: > -- > -- > > Jul 12, 2016 3:43:15 PM > org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: BUILD FAILURE > > Jul 12, 2016 3:
Re: Cobertura Maven Plugin works locally, but not in Jenkins
Hi Do you have a sample project to reproduce the issue? On Wednesday, 13 July 2016, Hohl, Gerrit wrote: > Hello everyone, > > > > I faced an odd problem today: > > We have a Maven Build which also includes the creation of a > documentation. > > One of the plugins creating the reports is the Cobertura Maven Plugin. > > If I execute it on my local machine it works perfectly. > > Also the project has no code at all (it's more an Ant and aggregation > project) it creates the documentation and also deploys it. > > > > But if I try to build the same project in our Jenkins build service the > Maven jobs just days while trying to execute the Cobertura Maven Plugin. > > I added --debug, but also if the debug messages are enabled I don't see > an error, stack trace or whatever in the log. > > On my local machine the output looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [DEBUG] Created new class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Importing foreign packages into class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Imported: < maven.api > > [DEBUG] Imported: org.apache.maven.doxia.logging.Log < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [DEBUG] Imported: org.apache.maven.doxia.logging.LogEnabled < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [...] > > > > The output with the Jenkins server looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [JENKINS] Archiving site from c:\jenkins_data\workspace\target\site to > C:\.jenkins\jobs\xxx\site > > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: BUILD FAILURE > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Total time: 35.284s > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Finished at: Tue Jul 12 15:43:15 CEST 2016 > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Final Memory: 24M/174M > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > sessionEnded > > INFORMATION: > > > [...] > > > > And that is it. No errors, no stack traces, no messages. > > Jenkins uses the same Java version and same Maven version like my local > build. > > We use an internal Nexus server as proxy for the artifacts. > > Means my local Maven installation as well as the one Jenkins uses are > using the same artifact repository. > > > > Any ideas on this? > > > > Regards, > > Gerrit > > > > -- Olivier
Re: Cobertura Maven Plugin works locally, but not in Jenkins
Welcome to the evil one. I have a blog post entitled "Maven job type considered evil" Basically the issue is that Jenkins (via the evil one) is injecting a remoting channel into your maven execution nd using that channel to both modify and monitor the build. One of the plugins that does this is the cobertura plugin. If it sees you running cobertura it says "I'll have some of that, oh and let's tweak the configuration while we are at it" There may be a configuration option to tell the Jenkins cobertura plugin to leave this job alone... Otherwise I recommend switching to either freestyle or pipeline (got to love pipeline) One of these days I'll get time to write my (long planned) replacement for the evil one that does not do evil things... Until that day, you have a tricky choice... Configure nothing and run the risk of it blowing up in your face or use freestyle On Tuesday 12 July 2016, Hohl, Gerrit wrote: > Hello everyone, > > > > I faced an odd problem today: > > We have a Maven Build which also includes the creation of a > documentation. > > One of the plugins creating the reports is the Cobertura Maven Plugin. > > If I execute it on my local machine it works perfectly. > > Also the project has no code at all (it's more an Ant and aggregation > project) it creates the documentation and also deploys it. > > > > But if I try to build the same project in our Jenkins build service the > Maven jobs just days while trying to execute the Cobertura Maven Plugin. > > I added --debug, but also if the debug messages are enabled I don't see > an error, stack trace or whatever in the log. > > On my local machine the output looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [DEBUG] Created new class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Importing foreign packages into class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Imported: < maven.api > > [DEBUG] Imported: org.apache.maven.doxia.logging.Log < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [DEBUG] Imported: org.apache.maven.doxia.logging.LogEnabled < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [...] > > > > The output with the Jenkins server looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [JENKINS] Archiving site from c:\jenkins_data\workspace\target\site to > C:\.jenkins\jobs\xxx\site > > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: BUILD FAILURE > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Total time: 35.284s > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Finished at: Tue Jul 12 15:43:15 CEST 2016 > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Final Memory: 24M/174M > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > sessionEnded > > INFORMATION: > > > [...] > > > > And that is it. No errors, no stack traces, no messages. > > Jenkins uses the same Java version and same Maven version like my local > build. > > We use an internal Nexus server as proxy for the artifacts. > > Means my local Maven installation
Re: Cobertura Maven Plugin works locally, but not in Jenkins
I've had similar, where versions between locally and jenkins where different. Question to ask yourself to see if you have checked; ) maven version used locally vs jenkins ) java version used locally vs jenkins ) operating system? same? both 32bit or 64bit? ) does your jenkins project have a private repo? ) do you define all plugins used within your pom? I've had issues so now I always define all plugins used in the pom, I also use the prerequisites to define maven version, plus the following properties, maven.compiler.source, maven.compiler.target, project.build.sourceEncoding, project.build.outputEncoding, project.reporting.outputEncoding. If your able to log into the jenkins box, if you manually execute the same command as you do locally does it work? Try deleting the jenkins repo. After several issues, I always setup each jenkins project to use a separate maven repo i.e. per workspace. Always define exact plugin version to use, checking with versions:display-plugin-updates to make sure non are being pulled in from the super pom. I've not had anymore issues, but saying that I don't know if things have got better or not. John On 12 July 2016 at 15:48, Hohl, Gerrit wrote: > Hello everyone, > > > > I faced an odd problem today: > > We have a Maven Build which also includes the creation of a > documentation. > > One of the plugins creating the reports is the Cobertura Maven Plugin. > > If I execute it on my local machine it works perfectly. > > Also the project has no code at all (it's more an Ant and aggregation > project) it creates the documentation and also deploys it. > > > > But if I try to build the same project in our Jenkins build service the > Maven jobs just days while trying to execute the Cobertura Maven Plugin. > > I added --debug, but also if the debug messages are enabled I don't see > an error, stack trace or whatever in the log. > > On my local machine the output looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [DEBUG] Created new class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Importing foreign packages into class realm > plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [DEBUG] Imported: < maven.api > > [DEBUG] Imported: org.apache.maven.doxia.logging.Log < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [DEBUG] Imported: org.apache.maven.doxia.logging.LogEnabled < > plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 > > [...] > > > > The output with the Jenkins server looks like this: > > > > [...] > > [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin > > [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from > the reporting.plugins section: 2.7 > > [INFO] configuring report plugin > org.codehaus.mojo:cobertura-maven-plugin:2.7 > > [...] > > [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: > > [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile > > [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile > > [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile > > [...] > > [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile > > [JENKINS] Archiving site from c:\jenkins_data\workspace\target\site to > C:\.jenkins\jobs\xxx\site > > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logResult > > INFORMATION: BUILD FAILURE > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: > > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Total time: 35.284s > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Finished at: Tue Jul 12 15:43:15 CEST 2016 > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > logStats > > INFORMATION: Final Memory: 24M/174M > > Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger > sessionEnded > > INFORMATION: > --
Cobertura Maven Plugin works locally, but not in Jenkins
Hello everyone, I faced an odd problem today: We have a Maven Build which also includes the creation of a documentation. One of the plugins creating the reports is the Cobertura Maven Plugin. If I execute it on my local machine it works perfectly. Also the project has no code at all (it's more an Ant and aggregation project) it creates the documentation and also deploys it. But if I try to build the same project in our Jenkins build service the Maven jobs just days while trying to execute the Cobertura Maven Plugin. I added --debug, but also if the debug messages are enabled I don't see an error, stack trace or whatever in the log. On my local machine the output looks like this: [...] [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from the reporting.plugins section: 2.7 [INFO] configuring report plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 [...] [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile [...] [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile [DEBUG] Created new class realm plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 [DEBUG] Importing foreign packages into class realm plugin>org.codehaus.mojo:cobertura-maven-plugin:2.7 [DEBUG] Imported: < maven.api [DEBUG] Imported: org.apache.maven.doxia.logging.Log < plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 [DEBUG] Imported: org.apache.maven.doxia.logging.LogEnabled < plugin>org.apache.maven.plugins:maven-site-plugin:3.5.1 [...] The output with the Jenkins server looks like this: [...] [DEBUG] resolving version for org.codehaus.mojo:cobertura-maven-plugin [DEBUG] resolved org.codehaus.mojo:cobertura-maven-plugin version from the reporting.plugins section: 2.7 [INFO] configuring report plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 [...] [DEBUG] org.codehaus.mojo:cobertura-maven-plugin:jar:2.7: [DEBUG]net.sourceforge.cobertura:cobertura:jar:2.1.1:compile [DEBUG] org.ow2.asm:asm:jar:5.0.1:compile [DEBUG] org.ow2.asm:asm-tree:jar:5.0.1:compile [DEBUG] org.ow2.asm:asm-commons:jar:5.0.1:compile [...] [DEBUG]org.apache.maven.shared:maven-invoker:jar:2.0.11:compile [JENKINS] Archiving site from c:\jenkins_data\workspace\target\site to C:\.jenkins\jobs\xxx\site Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logResult INFORMATION: Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logResult INFORMATION: BUILD FAILURE Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logStats INFORMATION: Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logStats INFORMATION: Total time: 35.284s Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logStats INFORMATION: Finished at: Tue Jul 12 15:43:15 CEST 2016 Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger logStats INFORMATION: Final Memory: 24M/174M Jul 12, 2016 3:43:15 PM org.apache.maven.cli.event.ExecutionEventLogger sessionEnded INFORMATION: [...] And that is it. No errors, no stack traces, no messages. Jenkins uses the same Java version and same Maven version like my local build. We use an internal Nexus server as proxy for the artifacts. Means my local Maven installation as well as the one Jenkins uses are using the same artifact repository. Any ideas on this? Regards, Gerrit