Error occurs in jenkins build of unity - ios

Machine:Mac
UnityVer:4.6.2
error of the following will appear when you have made a jenkins build of unity.
----- Total AssetImport time: 6.818127s, AssetImport time: 6.808909s, Asset hashing: 0.005416s [60.9 KB, 10.972655 mb/s]
Platform assembly: /Applications/Unity4.6.2/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/System.Data.dll (this message is harmless)
System memory in use before: 71.7 MB.
Unloading 137 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
System memory in use after: 66.8 MB.
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 6940.
Total: 18.863014 ms (FindLiveObjects: 0.248059 ms CreateObjectMapping: 0.096515 ms MarkObjects: 1.745080 ms DeleteObjects: 0.012070 ms)
Scripts have compiler errors.
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 127)
Aborting batchmode due to failure:
Scripts have compiler errors.
Thread 'UnityLookForNewInputDevices' is still running!
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp Line: 68)
Thread was not cleaned up!
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Threads/Posix/PlatformThread.cpp Line: 45)
FATAL: Unity3d command line execution failed with status 1
Build step 'Invoke Unity3d Editor' marked build as failure
FTP: Current build result is [FAILURE], not going to run.
Finished: FAILURE

Try search "error" in Jenkins console output. It's very easy to overlook what actually causing build fail. The error show in the bottom of console output is the result. The useful information is where all warnings and errors are shown like you normally see in IDE like visual studio. I spend a whole afternoon found out I should always use Control + F instead of my eyes to search through things like Jenkins console output.

The output shows you the problem: you have script errors. Until you fix your script errors, you won't be able to build.
You haven't included the script errors, so no-one can give you any more info. When you fix them, you'll probably find that it's nothing to do with Jenkins, and the question title is unrelated.
Usual causes of this:
You have some editor scripts in you project
You forgot to put #if guards around editor scripts and/or external scripts
You forgot to copy/paste one of your 3rd party libraries or plugins onto the machine where you're doign the build - and it's not in source control already (where it should be).

Related

Jenkins (2.297) build fails because an "output.xml" file could not be parsed

i set up an Jenkins-> robot framework chain where the robot tasks are stimulated by Jenkins.
The example robot tasks (some simple shell scripts) are executed without errors, but Jenkind fails because it is not able to parse some "output.xml" file which has nothing to do with the robot framework tasks.
Error message:
[ ERROR ] Reading XML source '/var/lib/jenkins/workspace/Test/output.xml' failed:ParseError: junk after document element: line 188, column 0
When i investigate the "output.xml" there is indeed an error:
...
rrors>
</errors>
</robot>
This behavior is already known and active and is described in https://issues.jenkins.io/browse/JENKINS-62359?attachmentViewMode=list
in 2020, but the error is still appearing.
Is there a solution or workaround? It is curious that sometimes the build is executing without an error when nothing changed.

I am migrating a project from maven to bazel and getting error

i am following the official bazel documentation for migrating from maven to bazel and used rules_jvm_external to defined external dependencies in workspace file and Build file. But I am getting the follwing error.
C:/users/kunal_visoulia/_bazel_kunal_visoulia/3f5dzdsz/external/maven/BUILD:1212:1: in deps attribute of jvm_import rule #maven//:commons_digester_commons_digester: rule '#maven//:xml_apis_xml_apis' does not exist
ERROR: Analysis of target '//:everything' failed; build aborted: Analysis of target '#maven//:commons_digester_commons_digester' failed; build aborted
INFO: Elapsed time: 724.364s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 371 targets configured)
Fetching #remotejdk11_win; Restarting.
i am using private nexus repo and also the official maven repo. Please help
I've successfully reproduced your error and found the following workaround:
Add xml-apis:xml-apis:1.4.01 and junit:junit-dep:4.9 to your
list of artifacts.
Add the version_conflict_policy = "pinned"
attribute to maven_install.
The root cause is https://github.com/bazelbuild/rules_jvm_external/issues/250. The missing dependencies are artifacts that relocated to new GAV coordinates, which the coursier resolver cannot handle yet. The general workaround is to manually add the legacy GAV coordinates into maven_install.
Specifically, xml-apis:xml-apis:2.0.2 relocated to xml-apis:xml-apis:1.0.b2 (but 1.4.0.1 wasn't relocated), and junit:junit-dep:4.9 relocated to junit:junit.

How do I make the mstest results available from the TFS build page?

I have a build workflow (xaml) that invokes mstest. My expectation is that there would be a link to the test results available on the build summary page. However, this is not the case.
The build ends with the MSTest command - exits with 1, since there are failures. So, MSTest is the last activity in the workflow.
Something is definitely wrong here. The drop location contains just the workflow logs - no test results. These are found in the TestResults folder, but not in the drop location.
So, my question is - how do I need to wire the MSTest activity so that at the end there would be a link somewhere to the test results?
Now the gory details. This is how the last moments of the workflow look like in the activity log (I replaced some stuff with [...] for the sake of brevity). Notice the following message at the end:
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
But where is it published?
MSTest
Inputs
TestLists:
ToolPath:
TestNames:
MinPriority: -1
TestSettings:
CommandLineArguments:
SearchPathRoot: d:\b\test\3269\..\2282\Binaries
Platform: Any CPU
MaxPriority: -1
Category:
RunTitle:
PathToResultsFilesRoot: d:\b\test\3269\..\2282\TestResults
TestContainers: System.Linq.Enumerable+WhereEnumerableIterator`1[System.String]
TestMetadata:
TestConfigName:
Flavor: Release
TestConfigId: -1
Publish: True
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe /nologo /usestderr /searchpathroot:"d:\b\test\3269\..\2282\Binaries" /resultsfileroot:"d:\b\test\3269\..\2282\TestResults" /testcontainer:"d:\b\test\2282\Binaries\BackgroundJobTests.dll" [...] /publish:"http://tfsserver:8080/tfs/defaultcollection" /noprompt /publishbuild:"vstfs:///Build/Build/265747" /teamproject:"DFDev" /platform:"Any CPU" /flavor:"Release"
Loading d:\b\test\2282\Binaries\BackgroundJobTests.dll...
[...]
Starting execution...
Warning: The disabled test 'GetJobReqModels' was removed from the test run.
Results Top Level Tests
------- ---------------
Passed BackgroundJobTests.AsyncParallelSqlRunnerTest.AsyncExceptionInDoIt
[...]
Passed WFMCommonTest.TimesheetApi.UnitTests.TimeSegmentApiTests.Test_RoundTimeOfOneSegment
1778/5035 test(s) Passed, 3224 Failed, 33 Error
Summary
-------
Passed 1778
Failed 3224
Error 33
------------
Total 5035
Results file: d:\b\test\2282\TestResults\tfsbuild_TORSVARCH01 2017-03-02 16_03_43_Any CPU_Release.trx
Test Settings: Default Test Settings
Test Run Error.
Run has the following issue(s):
Warning: Test Run deployment issue: The assembly or module 'dtSearchNetApi2' directly or indirectly referenced by the test container 'd:\b\test\2282\binaries\ruleenginetests.dll' was not found.
[...]
Warning: Test Run deployment issue: The assembly or module 'System.ServiceModel.Web' directly or indirectly referenced by the test container 'd:\b\test\2282\binaries\utilitytest.dll' was not found.
One of the background threads threw exception:
System.Data.OleDb.OleDbException (0x80004005): Cannot open database "851qa89" requested by the login. The login failed.
[...]
One of the background threads threw exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
[...]
Waiting to publish...
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
Exception Message: MSTest.exe returned an exit code of 1 indicating that not all tests passed. (type TestFailureException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities
EDIT 1
We are using TFS 2015. The build template is a custom one.
The mstest command line parameters can be observed from the aforementioned sample, but here they are again broken one per line for convenience:
/nologo
/usestderr
/searchpathroot:"d:\b\test\3269\..\2282\Binaries"
/resultsfileroot:"d:\b\test\3269\..\2282\TestResults"
/testcontainer:"d:\b\test\2282\Binaries\BackgroundJobTests.dll" ...
/publish:"http://tfsserver:8080/tfs/defaultcollection"
/noprompt
/publishbuild:"vstfs:///Build/Build/265747"
/teamproject:"DFDev"
/platform:"Any CPU"
/flavor:"Release"
The d:\b\test\2282\TestResults folder indeed contains the trx file and an auxiliary directory. But that is not good enough - I want to seem them online. And mstest claims they are published:
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
But what is the address?
EDIT 2
I checked the online summary page of the build and the test results link is there, but it is not found on the summary page that one can view in the Visual Studio.
Please, observe the page I can see in the Visual Studio 2015:
Now the same page when accessed through a browser. Notice the hyperlink to the test on the right side of the page:
So, I suppose my question can be narrowed down to how can one see this link on the build summary page in Visual Studio?
EDIT 3
Here is my almost entire build workflow - http://pastebin.com/9z2UE79E
In order to save some space I removed two pieces:
An InvokeProcess activity to upgrade a database
An InvokeProcess activity to modify a certain config file.
I do not understand what do I have to do to include the Test Summary on the overall Summary page.
It seems you use the /publish option in MSTest activity. Use the /publish option to publish test data to the database for the team project collection associated with the project's Team Foundation Server.
Check: https://msdn.microsoft.com/en-us/library/ms243151(v=vs.120).aspx

Building draw.io WAR

I am trying to create a Docker image that runs draw.io (https://www.draw.io/).
I recently did download the draw.io git repository from https://github.com/jgraph/draw.io (version 5.6.0.3) and spend quite some time building draw.war (which can be deployed in a web container), without any luck so far. I did read all the draw.io documentation that is provided in the repository and searched the internet for hours to find out how to build draw.war, but I couldn't find an answer.
The root directory of the repository is /tmp/draw.io-master/ and the ANT build file (build.xml) and related propery file (build.properties) can be found in /tmp/draw.io-master/etc/build
When I run 'ant' from /tmp/draw.io-master/etc/build I get the following error:
Buildfile: /tmp/draw.io-master/etc/build/build.xml
[jscomp] Compiling 1 file(s) with 40 extern(s)
[jscomp] ERROR - Cannot read: /tmp/draw.io-master/etc/build/${desktop.dir}/Desktop-Init.js
[jscomp] 1 error(s), 0 warning(s)
BUILD FAILED
/tmp/draw.io-master/etc/build/build.xml:451: Compilation failed.
Total time: 0 seconds
When I run 'ant war -buildfile /tmp/draw.io-master/etc/build/build.xml -propertyfile /tmp/draw.io-master/etc/build/build.properties -Dbasedir=/tmp/draw.io-master/etc/build -Ddesktop.dir=/tmp' I get the following error:
Buildfile: /tmp/draw.io-master/etc/build/build.xml
[jscomp] Compiling 1 file(s) with 40 extern(s)
[jscomp] ERROR - Cannot read: /tmp/Desktop-Init.js
[jscomp] 1 error(s), 0 warning(s)
BUILD FAILED
/tmp/draw.io-master/etc/build/build.xml:451: Compilation failed.
Total time: 0 seconds
I don't know what the right value of 'desktop.dir' is and I also don't know how to obtain / create Desktop-Init.js.
Any suggestions?
To fallback to http instead of https, you could use a redirection in Jetty, and add the url parameter "https=0", see https://support.draw.io/pages/viewpage.action?pageId=12878136.
Any place where you could share the resulting war, if successful?

Sonar and TFS 2013 : No ProjectInfo.xml files were found

When I run TFS 2013 with sonar I get the following error: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'.
I use :
sonarqube-5.1.zip
sonar-csharp-plugin-4.0.jar
SonarQube.MSBuild.Runner-0.9.zip
sonar-runner-dist-2.4.zip
I've followed instructions found in "SonarQube Installation Guide for Existing TFS Environment.pdf".
Any help ?
Thank you.
Log :
SonarQube Analysis Summary
Analysis failed for SonarQube project "WpfApplication2", version 1.0
Product projects: 0, test projects: 0
Invalid projects: 0, skipped projects: 0, excluded projects: 0
Résumé
Debug | x86
0 erreur(s), 1 avertissement(s)
$/Essai2/WpfApplication2/WpfApplication2.sln - 0 erreur(s), 1 avertissement(s),
Afficher le fichier journal
C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln.metaproj : The specified solution configuration "Debug|x86" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
$/Essai2/WpfApplication2/WpfApplication2.sln compilé
Aucun résultat des tests
Aucun résultat de couverture du code
Autres erreurs et avertissements
2 erreur(s), 0 avertissement(s)
01:45:52: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
Exception Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'. See the build logs for more details. (type UnexpectedExitCodeException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Here is the Diagnostic (I truncated the source check out part) :
Compile, Test and Publish00:00:46
Run optional script before MSBuild00:00:08
InputsEnvironmentVariables:
Enabled: True
Arguments: /key:WpfApplication2 /name:WpfApplication2 /version:1.0
FilePath: C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
OutputsResult: 0
C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe /key:WpfApplication2 /name:WpfApplication2 /version:1.0
Pre-processing (3 arguments passed)
Using environment variables to determine the download directory...
Using environment variable 'TF_BUILD_BUILDDIRECTORY', value 'C:\Builds\1\Essai2\WpfApplication2'
Creating the analysis bin directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
SonarQube server url: http://localhost:9000
Downloading SonarQube.MSBuild.Runner.Implementation.zip from http://localhost:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.Runner.Implementation.zip
Executing file C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.PreProcessor.exe
Args: "/key:WpfApplication2" "/name:WpfApplication2" "/version:1.0"
Working directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
Timeout (ms):300000
Process id: 4168
01:45:11: The path to the sonar-runner.properties file was not supplied on the command line. Attempting to locate the file...
01:45:11: Located the runner properties file: C:\sonar-runner-2.4\conf\sonar-runner.properties
01:45:11: Legacy TeamBuild environment detected
01:45:11: Creating config and output folders...
01:45:11: Removing the existing directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf
01:45:11: Creating directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf
01:45:11: Removing the existing directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\out
01:45:11: Creating directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\out
Generating the FxCop ruleset...
01:45:14: Saving the config file to C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf\SonarQubeAnalysisConfig.xml
Process returned exit code 0
Run MSBuild00:00:12
InputsProjectsToBuild: String[] Array
MSBuildMultiProc: True
Verbosity: Normal
ToolPlatform: Auto
Targets:
RunCodeAnalysis: AsConfigured
CommandLineArguments: /p:SkipInvalidConfigurations=true /p:Configuration=Debug /p:Platform="Any CPU"
ConfigurationsToBuild: String[] Array
OutputLocation: SingleFolder
Enabled: True
ToolVersion:
CleanBuild: True
OutDir:
RestoreNuGetPackages: True
C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe restore "C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln" -NonInteractive
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln" /nr:False /fl /flp:"logfile=C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:Configuration=Debug /p:Platform="Any CPU" /m /p:OutDir="C:\Builds\1\Essai2\WpfApplication2\bin\\" /p:Configuration="Debug" /p:Platform="x86" /p:VCBuildOverride="C:\Builds\1\Essai2\WpfApplication2\src\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2.sln.x86.Debug.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/52;IgnoreDuplicateProjects=False;InformationNodeId=12;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;LogProjectNodes=True;LogWarnings=True;TFSUrl=http://localhost:8080/tfs/DefaultCollection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="dbda6e4d-d5bc-4eed-8b3e-6cc79e3721cc,vstfs:///Build/Build/52" /p:BuildLabel="WpfApplication2_20150615.3" /p:BuildTimestamp="Mon, 15 Jun 2015 11:44:59 GMT" /p:BuildSourceVersion="LWpfApplication2_20150615.3#$/Essai2" /p:BuildDefinition="WpfApplication2"
Run optional script after MSBuild00:00:00
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath:
OutputsResult: 0
Run optional script before Test Runner00:00:00
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath:
OutputsResult: 0
Run VS Test Runner00:00:00
InputsTestSpecs: BuildParameter[] Array
Enabled: False
ConfigurationsToTest: String[] Array
OutDir:
This activity was not run since its Enabled property was set to False.
Run optional script after Test Runner00:00:25
InputsEnvironmentVariables:
Enabled: True
Arguments:
FilePath: C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
OutputsResult: 0
C:\sonarqube\bin\SonarQube.MSBuild.Runner.exe
Post-processing (no arguments passed)
Using environment variables to determine the download directory...
Using environment variable 'TF_BUILD_BUILDDIRECTORY', value 'C:\Builds\1\Essai2\WpfApplication2'
Executing file C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin\SonarQube.MSBuild.PostProcessor.exe
Args:
Working directory: C:\Builds\1\Essai2\WpfApplication2\sqtemp\bin
Timeout (ms):3600000
Process id: 6548
01:45:28: Legacy TeamBuild environment detected
01:45:28: Loading the SonarQube analysis config from C:\Builds\1\Essai2\WpfApplication2\sqtemp\conf\SonarQubeAnalysisConfig.xml
01:45:28: Legacy TeamBuild environment detected
01:45:28: Attempting to locate the CodeCoverage.exe tool...
01:45:28: Code coverage command line tool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
01:45:28: Fetching code coverage report information from TFS...
01:45:28: Connecting to TFS...
01:45:29: Fetching build information...
01:45:30: Fetch code coverage report info...
01:45:52: Operation timed out, Elapsed time (ms): 20358
01:45:52: ...done.
01:45:52: No code coverage reports were found for the current build.
01:45:52: Generating SonarQube project properties file to C:\Builds\1\Essai2\WpfApplication2\sqtemp\out\sonar-project.properties
01:45:52: No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
01:45:52: Writing processing summary to C:\Builds\1\Essai2\WpfApplication2\sqtemp\out\ProjectInfo.log
01:45:52: Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
01:45:52: Updating the TeamBuild summary...
Process returned exit code 1
Exception Message: TF270015: 'SonarQube.MSBuild.Runner.exe' returned an unexpected exit code. Expected '0'; actual '1'. See the build logs for more details. (type UnexpectedExitCodeException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Handle Exception
Troubleshooting issues with the MSBuild.Runner v0.9
The following information is provided to help troubleshooting issues with version 0.9 of the MSBuild.Runner. The behaviour may change in later versions.
Most serious configuration issues will result in warnings or errors that will appear on the Build Summary page. In cases in which there are no errors or warnings reported, check the TFS TeamBuild diagnostic output (click on "Diagnostics" link at the top of the build summary report in Visual Studio). Both the pre- and post-processor steps log quite a lot of information to help diagnose issues.
1. Check the SonarQube Analysis Summary section appears in the Build Summary Report
The section should look like this:
SonarQube Analysis Summary
Analysis failed for SonarQube project "Simple console app", version 1.0
Product projects: 4, test projects: 2
Invalid projects: 0, skipped projects: 0, excluded projects: 0
If the section does not appear on the build summary page then there are configuration issues with the build agent, build definition, or both. Read the steps below to diagnose these further.
1.1 Check the number of projects that are reported in the summary
If no projects were found then it suggests that the integration targets are not being imported and used during the build.
If all of the projects are marked as invalid, it is likely that you are building more than one configuration e.g. [release or debug] | [x86 or x64]. You should also get an error saying no ProjectInfo.xml files could be found.
You can only analyse one configuration at a time. If you want to analyze both release and debug builds, then you will need to create a separate build definition for each, using different SonarQube project ids.
The diagnostic log will contain more infomation about why a project was invalid, which is normally because the project doesn't have a guid, or the guid is not unique. The normal reason for a non-unique guid is that you are building multiple configurations e.g. release and debug.
2. Check that the pre-build step is being executed
The diagnostic output should contain output similar to the following:
Run optional script before MSBuild
C:\SonarQube\bin\SonarQube.MSBuild.Runner.exe /key:MyProject /name:"My Project" /version:1.0
Pre-processing (3 arguments passed)
If it doesn't, check that the you are correctly calling SonarQube.MSBuild.Runner.exe in the "Pre-build script" step in the build definition. An easy mistake is to put the script parameters in the wrong box by setting the "Post-build" properties instead (unhelpfully, the Post-build fields in the UI appear before the Pre-build fields).
2. Check that the post-build step is being executed
The diagnostic output should contain output similar to the following:
Run optional script after Test Runner
C:\SonarQube\bin\SonarQube.MSBuild.Runner.exe
Post-processing (no arguments passed)
If it doesn't, check that the you are correctly calling SonarQube.MSBuild.Runner.exe in the "Post-test script" step in the build definition.
3. Check the rest of the diagnostic log
If the pre- and post- build steps are being executed correctly, check the rest of the diagnostic output for any clues as to what isn't working. Pay particular attention to messages from the pre- and post-processor about the directories and files they are writing to.
4. Check the files that have been created on the build agent
The analysis process creates temporary files under the build directory under a folder called SQTemp in v0.9.
Examining the contents of the folders can help determine the stage at which the analysis is failing.
The expected folders are as follows:
bin: this folder contains the analysis targets and binaries. It is created by the SonarQube.MSBuild.Runner.exe which downloads the files from the SonarQube server. If this folder does not exist or is empty then the analysis failed at a very early stage and there should warnings or errors. Check that the C# plugin v4 is installed correctly on the SonarQube server, and that the SonarQube has been restarted since the plugin was installed.
conf: this folder is created during pre-processing and contains the settings downloaded from the SonarQube server. If there are any FxCop rules active in the SonarQube the folder should contain an FxCop ruleset.
out: this folder is populated during the MSBuild phase. It should contain one folder per project being built. It will also contain the generated sonar-project.properties file that is passed to the sonar-runner. If the folder is empty then it is possible the SonarQube.Integration.targets are not being imported correctly.
The error message "No ProjectInfo.xml files were found" will normally appear in this case. The ProjectInfo.xml files are generated by the target "WriteSonarQubeData" in the SonarQube.Integration.targets, so the next thing to check is that SonarQube.Integration.targets are being imported correctly and the expected targets are being executed.
5. Checking the SonarQube.Integration.targets are imported and called
Firstly, double-check the installation of the SonarQube.Integration.ImportBefore.targets file:
check it is in the correct folder for the version of MSBuild you are using i.e. %ProgramFiles(x86)%\MSBuild\[12.0 or 14.0]\Microsoft.Common.Targets\ImportBefore
check for typos in the folder name "ImportBefore" (should be singular, not plural)
(Thanks to Richard from BlackMarble for this tip).
If the targets are installed correctly then you will need to increase the verbosity of the MSBuild logging to diagnostic and build again so you can check the detailed MSBuild output. Unfortunately, there doesn't seem to be a simple way to increase the verbosity of the MSBuild logs when running under TeamBuild 2013. You can produce an additional log file with more detail, but you will need access to the build agent machine to pick up the log file.
To create an MSBuild log with more detailed info:
select "Queue New Build" from the BUILD menu in Visual Studio
click on the "Parameters" tab.
Expand the "2. Build" section and the "5. Advanced" sections
Set the "MSBuild arguments" property to the following:
/m:1 /fl2 /flp2:"verbosity=diagnostic"
The "/m:1" tells MSBuild not to build in parallel which can make the log easier to read. The other two parameters tell MSBuild to log to a file. See the MSBuild command line help for more info.
Click "Queue" and wait for the build to finish.
Find and open the log on the build agent. It should be called msbuild2.log and be under the source directory for your build definition.
If the SonarQube.Intergration.ImportBefore.targets are being executed, there will be a log entry saying the "SonarQubeImportBeforeInfo" target was executed. There should be some output message saying whether the file "SonarQube.Integration.targets" was located or not.
The ProjectInfo.xml files are written by the target "WriteSonarQubeProjectData". The log should show that this target has been executed, and the "WriteProjectInfoFile" task has executed. If not, the log should give an idea of why the targets were skipped.

Resources