I have successfully setup TeamCity to integrate with SonarQube and produce basic reports during a build.
However now that I've enabled all the FXCop rules in SonarQube, **it fails to run* with the following message in the TeamCity build log:
Caused by: java.lang.IllegalArgumentException: No FxCop analysis has been performed on this project, whereas it contains cs files: Verify that you are using the latest version of the SonarQube Scanner for MSBuild, and if you do, please report a bug. In the short term, you can disable all FxCop rules from your quality profile to get rid of this error.
The project is setup to build with Visual Studio version Microsoft Visual Studio 2015 in TeamCity.
However the following warning appears in the TeamCity build log, making me think that it's not actually using the Roslyn compiler.
***********************************************************************************
* Use MSBuild 14 to get the best analysis results *
* The use of MSBuild 12 or the sonar-scanner to analyze C# projects is DEPRECATED *
***********************************************************************************
From reading up on the SonarQube scanner for MS Build at http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild it has the following to say
The SonarQube Scanner for MSBuild requires your project to be built with MSBuild 14.0.
MSBuild 14.0 ships both as part of Visual Studio 2015 and as part of the standalone Microsoft Build Tools 2015. While installing Visual Studio on the analysis machine is not mandatory, we recommend doing so in order to benefit from its additional features such as running VSTest or MSTest unit tests, or FxCop analysis.
I also tried changing TeamCity to use the *MSBuild** runner with MSBuild ToolsVersion 14.0 specified and I still get the same behaviour.
So it would appear that Roslyn is being used to compile the project.
I don't know where to go from here. What am I doing wrong?
Versions
TeamCity 9.1.4
SonarQube 5.6
Version 31 of the Sonar runner plugin
Build server has MS Build 14.0 tools installed
Full build log details
[09:56:00][Step 10/10] 09:56:00.842 INFO - Sensor org.sonar.plugins.csharp.CSharpSensor (done) | time=4783ms
[09:56:00][Step 10/10] 09:56:00.842 INFO - Sensor org.sonar.plugins.csharp.CSharpFxCopProvider$CSharpFxCopSensor
[09:56:00][Step 10/10] INFO: ------------------------------------------------------------------------
[09:56:00][Step 10/10] INFO: EXECUTION FAILURE
[09:56:00][Step 10/10] INFO: ------------------------------------------------------------------------
[09:56:00][Step 10/10] Total time: 34.494s
[09:56:01][Step 10/10] Final Memory: 7M/109M
[09:56:01][Step 10/10] INFO: ------------------------------------------------------------------------
[09:56:01][Step 10/10] ERROR: Error during Sonar runner execution
[09:56:01][Step 10/10] org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[09:56:01][Step 10/10] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
[09:56:01][Step 10/10] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
[09:56:01][Step 10/10] at java.security.AccessController.doPrivileged(Native Method)
[09:56:01][Step 10/10] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
[09:56:01][Step 10/10] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
[09:56:01][Step 10/10] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
[09:56:01][Step 10/10] at org.sonar.runner.api.Runner.execute(Runner.java:100)
[09:56:01][Step 10/10] at org.sonar.runner.Main.executeTask(Main.java:70)
[09:56:01][Step 10/10] at org.sonar.runner.Main.execute(Main.java:59)
[09:56:01][Step 10/10] at org.sonar.runner.Main.main(Main.java:53)
[09:56:01][Step 10/10] Caused by: java.lang.IllegalArgumentException: No FxCop analysis has been performed on this project, whereas it contains cs files: Verify that you are using the latest version of the SonarQube Scanner for MSBuild, and if you do, please report a bug. In the short term, you can disable all FxCop rules from your quality profile to get rid of this error.
[09:56:01][Step 10/10] at org.sonar.plugins.fxcop.FxCopConfiguration.checkMandatoryProperties(FxCopConfiguration.java:104)
[09:56:01][Step 10/10] at org.sonar.plugins.fxcop.FxCopConfiguration.checkProperties(FxCopConfiguration.java:95)
[09:56:01][Step 10/10] at org.sonar.plugins.fxcop.FxCopSensor.analyse(FxCopSensor.java:96)
[09:56:01][Step 10/10] at org.sonar.plugins.fxcop.FxCopSensor.analyse(FxCopSensor.java:91)
[09:56:01][Step 10/10] at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[09:56:01][Step 10/10] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[09:56:01][Step 10/10] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[09:56:01][Step 10/10] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[09:56:01][Step 10/10] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[09:56:01][Step 10/10] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[09:56:01][Step 10/10] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[09:56:01][Step 10/10] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[09:56:01][Step 10/10] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[09:56:01][Step 10/10] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[09:56:01][Step 10/10] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[09:56:01][Step 10/10] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[09:56:01][Step 10/10] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
[09:56:01][Step 10/10] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
[09:56:01][Step 10/10] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[09:56:01][Step 10/10] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[09:56:01][Step 10/10] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[09:56:01][Step 10/10] at java.lang.reflect.Method.invoke(Method.java:497)
[09:56:01][Step 10/10] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
[09:56:01][Step 10/10] ... 9 more
[09:56:01][Step 10/10] Process exited with code 1
[09:56:01][Step 10/10] Step Run SonarQube (Static code analysis) (SonarQube Runner) failed
I too got same error. After switching to MSBuild.SonarQube.Runner-2.1 this error was no longer seen.
Used SonarQube Scanner for MSBuild: Launch analysis of .Net projects
http://docs.sonarqube.org/display/SCAN/Analyzing+Source+Code
Related
This question is related to Sonarqube. I want to run my c++ project, on executing scanner(this scanner code generated after creating new project on sonarqube) from my computer, i am getting this error.
...
ERROR: SonarQube server [https://sonarqube.factset.com] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.405s
INFO: Final Memory: 3M/20M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
...
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:81)
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:113)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
... 10 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at java.base/sun.security.validator.Validator.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 44 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
... 50 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Facing this error while configuring Apache Mahout.
I am using the following:
Java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Maven Version:
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.3.3.el6.x86_64", arch: "amd64", family: "unix"
Here is the error I am facing:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (job) on project mahout-mrlegacy: Failed to create assembly: Error creating assembly archive job: error in opening zip file -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (job) on project mahout-mrlegacy: Failed to create assembly: Error creating assembly archive job: error in opening zip file
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create assembly: Error creating assembly archive job: error in opening zip file
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:495)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.assembly.archive.ArchiveCreationException: Error creating assembly archive job: error in opening zip file
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:190)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:436)
... 21 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: error in opening zip file
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:472)
at org.apache.maven.plugin.assembly.filter.ComponentsXmlArchiverFileFilter.finalizeArchiveCreation(ComponentsXmlArchiverFileFilter.java:166)
at org.codehaus.plexus.archiver.AbstractArchiver.runArchiveFinalizers(AbstractArchiver.java:884)
at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:908)
at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:186)
... 22 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at org.codehaus.plexus.components.io.resources.PlexusIoZipFileResourceCollection.getEntries(PlexusIoZipFileResourceCollection.java:53)
at org.codehaus.plexus.components.io.resources.AbstractPlexusIoArchiveResourceCollection.getResources(AbstractPlexusIoArchiveResourceCollection.java:76)
at org.codehaus.plexus.components.io.resources.proxy.PlexusIoProxyResourceCollection.getResources(PlexusIoProxyResourceCollection.java:89)
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:468)
... 27 more
[ERROR]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :mahout-mrlegacy
Any help will be deeply appreciated.
I found the solution the problem:
I updated the version of Apache Maven which I was using to "Apache Maven 3.2.5" and also had to remove to ".m2" directory.
After than ran "mvn -DskipTests clean install" and things got resolved.
Hope this helps anyone who gets stuck on the same issue.
I use Java and Cucumber to run my test. My test passed and I want to generate a report after running the test by using Cucumber. So I run terminal: mvn clean verify. But I got these error as below:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running mgl.example.RunTest
#first
Feature: Test drag-drop and scroll options
Scenario: Drag-drop and scroll must be OK # MoveAndScroll.feature:3
Given I move from the root role dialog to choosing picture # AddNewDevice.i_move_from_the_root_role_dialog_to_choosing_picture()
When I Choose picture and click continue # AddNewDevice.i_Choose_picture_and_click_continue()
Then I can drag-drop device and scroll options # AddNewDevice.i_can_drag_drop_device_and_scroll_options()
1 Scenarios (1 passed)
3 Steps (3 passed)
2m12.865s
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 133.918 sec - in mgl.example.RunTest
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # Example ---
[INFO] Building jar: /Users/enclaveit/Documents/workspace/Example/target/Example-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-cucumber-reporting:0.0.6:generate (execution) # Example ---
About to generate
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:24 min
[INFO] Finished at: 2014-06-17T17:07:09+07:00
[INFO] Final Memory: 16M/200M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.masterthought:maven-cucumber-reporting:0.0.6:generate (execution) on project Example: Error Found: BUILD FAILED - Check Report For Details -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.masterthought:maven-cucumber-reporting:0.0.6:generate (execution) on project Example: Error Found:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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:606)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error Found:
at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:86)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: BUILD FAILED - Check Report For Details
at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:82)
... 21 more
[ERROR]
[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
Can somebody help me?
I ran into the same problem. The tests are executed, the report is generated but the BUILD FAILURE. This is the case if there are some validation errors. However, if I run the all-passing test cases then BUILD SUCCESS.
I guess if one of the test cases fails then BUILD FAILURE. If no failure in the run then BUILD SUCCESS. This is what I think.
There are some other questions about the POM:
failIfNoTests>false</failIfNoTests
testFailureIgnore>true</testFailureIgnore
These two lines above need to be inside sure-fire
I have configured my Maven2 project to generate a changelog report from a Mercurial repository (accessible via file:// protocol) but the goal execution fails with the following message:
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'changelog'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Phobos3 Prototype
[INFO] task-segment: [changelog:changelog]
[INFO] ------------------------------------------------------------------------
[INFO] [changelog:changelog {execution: default-cli}]
[INFO] Generating changed sets xml to: D:\Documents and Settings\501845922\Workspace\phobos3.prototype\target\changelog.xml
[INFO] EXECUTING: hg log --verbose
[WARNING] Could not figure out: abort: Invalid argument
[ERROR]
EXECUTION FAILED
Execution of cmd : log failed with exit code: -1.
Working directory was:
D:\Documents and Settings\501845922\Workspace\phobos3.prototype
Your Hg installation seems to be valid and complete.
Hg version: 1.4.3+20100201 (OK)
[ERROR] Provider message:
[ERROR]
EXECUTION FAILED
Execution of cmd : log failed with exit code: -1.
Working directory was:
D:\Documents and Settings\501845922\Workspace\phobos3.prototype
Your Hg installation seems to be valid and complete.
Hg version: 1.4.3+20100201 (OK)
[ERROR] Command output:
[ERROR]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Change Log report generation.
Embedded error: An error has occurred during changelog command :
Command failed.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has occurred in Change Log report generation.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has occurred in Change Log report generation.
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:79)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.apache.maven.reporting.MavenReportException: An error has occurred during changelog command :
at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:555)
at org.apache.maven.plugin.changelog.ChangeLogReport.getChangedSets(ChangeLogReport.java:393)
at org.apache.maven.plugin.changelog.ChangeLogReport.executeReport(ChangeLogReport.java:340)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Command failed.
at org.apache.maven.plugin.changelog.ChangeLogReport.checkResult(ChangeLogReport.java:705)
at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:467)
... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Apr 29 17:10:06 CEST 2010
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
What did I miss in a configuration? (I hope it is a configuration problem not a Maven plugins related bug!:) My repository URL seems to be ok (the plugin has been complaining before, I fixed that up), I also set a date format for parsing (also been complaining, also fixed).
target/changelog.xml being promised was not generated at all.
Maven 2.2.1
Mercurial 1.4.3
Windows XP SP3
mvn scm:changelog command provides an expected output.
Thanks for any suggestions, I haven't googled up anything (nor binged up;).
I did a test with a random project (noop, to be precise):
hg clone https://noop.googlecode.com/hg/ noop
And after configuring the dateFormat of the maven-changelog-plugin in the top pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changelog-plugin</artifactId>
<configuration>
<dateFormat>EEE MMM dd hh:mm:ss yyyy Z</dateFormat>
</configuration>
</plugin>
I've been able to run mvn changelog:changelog without troubles. My point is that the plugin seems to work for at least one project (chosen randomly :).
I'd really like to know if hg log --verbose behave correctly as the plugin seems to complain about it not running successfully. If it does, could you try to pass the -X option when running Maven and see if you get more useful information.
Also, please provide the content of your <scm> element.
When I'm using Maven with the cargo plug-ing to handle hot deployments to tomcat, maven fails on the clean task if the .war artifact doesn't currently exist. So if I run mvn clean, then mvn clean package - it errors out. What can I do to have cargo ignore that?
C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] [mcat5xRemoteDeployer] Undeploying [C:\work2\Fresh\fresh-ui\target\fresh.
war]
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\work2\Fresh\fresh-ui\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Aug 18 09:49:16 PDT 2009
[INFO] Final Memory: 9M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create deployable for the parameters (container [id = [tomcat5x
]], deployable type [war]).
C:\work2\Fresh\fresh-ui\target\fresh.war (The system cannot find the path specif
ied)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.codehaus.cargo.container.ContainerException: Failed to create deployable for
the parameters (container [id = [tomcat5x]], deployable type [war]).
at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:157)
at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
... 25 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
... 36 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Aug 18 09:49:22 PDT 2009
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>
From what I can see, you've bound deployer-undeploy to the pre-clean phase of the clean lifecycle. Thus, when performing the first clean, the war is safely undeployed and then target is removed. When performing the second clean, cargo:deployer-undeploy can't find the war in target and fails.
To me, Cargo shouldn't fail and this is likely a bug in Cargo's maven 2 plugin or in the core API that should handle this case gracefully. I'd open an issue in Cargo's issue tracker.
As mentioned by Rich in a comment, the current workaround is to run clean only once.