Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Maven Job Fails If A Read Variable Task Is Added Before Maven Task

Krishna Misra
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 30, 2018

Hi,

I'm trying to use the Inject Variables task prior to Maven 3.x task. This causes maven build to fail(exit with -1 code instead of 0). If I remove this, then it all works fine. Here are the logs and screenshot:-

 

 

 

Bamboo_Defec.png

simple 01-May-2018 07:04:25 Build mule3-cicd-example - mule3-cicd-example - Default Job #9 (MUL3PRJ-MUL3PL-JOB1-9) started building on agent Default Agent
simple 01-May-2018 07:04:25
simple 01-May-2018 07:04:25 Build working directory is C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1
simple 01-May-2018 07:04:25 Executing build mule3-cicd-example - mule3-cicd-example - Default Job #9 (MUL3PRJ-MUL3PL-JOB1-9)
simple 01-May-2018 07:04:25 Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
simple 01-May-2018 07:04:25 Checking out into C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1
simple 01-May-2018 07:04:25 Updating source code to revision: 7dfb3ab64d471cc3c706976b2ad45cdc72698a27
simple 01-May-2018 07:04:29 Git: Updating references
simple 01-May-2018 07:04:29 Git:
simple 01-May-2018 07:04:29 Fetching '+refs/heads/master:refs/heads/master' from 'https://bitbucket.org/krimisra24/cicd'.
simple 01-May-2018 07:04:29 Checking out revision 7dfb3ab64d471cc3c706976b2ad45cdc72698a27.
simple 01-May-2018 07:04:32 Updated source code to revision: 7dfb3ab64d471cc3c706976b2ad45cdc72698a27
simple 01-May-2018 07:04:32 Finished task 'Checkout Default Repository' with result: Success
simple 01-May-2018 07:04:32 Running pre-build action: VCS Version Collector
simple 01-May-2018 07:04:32 Starting task 'Inject Variables' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
command 01-May-2018 07:04:32 Beginning to execute external process for build 'mule3-cicd-example - mule3-cicd-example - Default Job #9 (MUL3PRJ-MUL3PL-JOB1-9)'\n ... running command line: \nC:\Users\krishnamisra\bamboo-home-new\temp\MUL3PRJ-MUL3PL-JOB1-9-ScriptBuildTask-4083120186627646746.ps1\n ... in: C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=master\nbamboo_repository_360450_previous_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_repository_360450_branch_name=master\nbamboo_planRepository_1_branchDisplayName=master\nbamboo_repository_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_capability_system_builder_msbuild_MSBuild_v14_0__64bit_=C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe\nbamboo_resultsUrl=http://10.211.55.3:8085/browse/MUL3PRJ-MUL3PL-JOB1-9\nbamboo_capability_system_builder_msbuild_MSBuild_v4_0__32bit_=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe\nbamboo_build_working_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\nbamboo_planRepository_1_name=cicd\nbamboo_buildKey=MUL3PRJ-MUL3PL-JOB1\nbamboo_shortPlanName=mule3-cicd-example\nbamboo_repository_360450_name=cicd\nbamboo_planRepository_name=cicd\nbamboo_buildNumber=9\nbamboo_short... Job\nbamboo_buildResultsUrl=http://10.211.55.3:8085/browse/MUL3PRJ-MUL3PL-JOB1-9\nbamboo_planRepository_repositoryUrl=https://bitbucket.org/krimisra24/cicd\nbamboo_agentId=196609\nbamboo_planName=mule3-cicd-example - mule3-cicd-example\nbamboo_shortPlanKey=MUL3PL\nbamboo_shortJobKey=JOB1\nbamboo_planRepository_revision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_buildTimeStamp=2018-05-01T07:04:25.579+10:00\nbamboo_repository_previous_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_planRepository_previousRevision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_buildResultKey=MUL3PRJ-MUL3PL-JOB1-9\nbamboo_repository_branch_name=master\nbamboo_buildPlanName=mule3-cicd-example - mule3-cicd-example - Default Job\nbamboo_planRepository_1_revision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_repository_name=cicd\nbamboo_dependenciesDisabled=false\nbamboo_buildFailed=false\nbamboo_planRepository_branch=master\nbamboo_agentWorkingDirectory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\nbamboo_planRepository_1_previousRevision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_planRepository_branchDisplayName=master\nbamboo_capability_system_jdk_JDK_1_8_0_151=C:\Program Files\Java\jdk1.8.0_151\nbamboo_planRepository_1_type=bbCloud\nbamboo_planRepository_branchName=master\nbamboo_capability_system_jdk_JDK=C:\Program Files\Java\jdk1.8.0_151\nbamboo_plan_storageTag=plan-425985\nbamboo_repository_360450_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_hg_cache_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\_hg-repositories-cache\nbamboo_planRepository_1_username=krimisra24\nbamboo_planRepository_type=bbCloud\nbamboo_capability_system_builder_msbuild_MSBuild_v14_0__32bit_=C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe\nbamboo_git_cache_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\_git-repositories-cache\nbamboo_ManualBuildTriggerReason_userName=admin\nbamboo_capability_system_builder_msbuild_MSBuild_v4_0__64bit_=C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe\nbamboo_capability_system_builder_mvn3_Maven_Executable___New=C:\softwares\apache-maven-3.3.9\nbamboo_tmp_directory=C:\Users\krishnamisra\bamboo-home-new\temp\nbamboo_working_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\nbamboo_capability_system_builder_mvn3_Maven_Executable=C:\maven\apache-maven-3.5.3-bin\apache-maven-3.5.3\nbamboo_planKey=MUL3PRJ-MUL3PL\nbamboo_planRepository_1_repositoryUrl=https://bitbucket.org/krimisra24/cicd\nbamboo_planRepository_username=krimisra24\nbamboo_capability_system_jdk_JDK_1_8=C:\Program Files\Java\jdk1.8.0_151\nbamboo_planRepository_1_branchName=master\n
simple 01-May-2018 07:04:32 Finished task 'Inject Variables' with result: Success
simple 01-May-2018 07:04:32 Starting task 'Read Variables' of type 'com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin:inject'
simple 01-May-2018 07:04:32 Injected variable bamboo.inject.ˇ˛test1=test1 in LOCAL scope
simple 01-May-2018 07:04:32 Injected variable bamboo.inject.= in LOCAL scope
simple 01-May-2018 07:04:32 Finished task 'Read Variables' with result: Success
simple 01-May-2018 07:04:32 Starting task 'Maven Task' of type 'com.atlassian.bamboo.plugins.maven:task.builder.mvn3'
command 01-May-2018 07:04:32 Beginning to execute external process for build 'mule3-cicd-example - mule3-cicd-example - Default Job #9 (MUL3PRJ-MUL3PL-JOB1-9)'\n ... running command line: \nC:\softwares\apache-maven-3.3.9\bin\mvn.cmd --batch-mode -Djava.io.tmpdir=C:\Program Files\Bamboo_New\temp\MUL3PRJ-MUL3PL-JOB1 -s C:/Users/krishnamisra/.m2/settings.xml -f mule3-cicd-example-api/pom.xml clean package\n ... in: C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=master\nbamboo_repository_360450_previous_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_repository_360450_branch_name=master\nbamboo_planRepository_1_branchDisplayName=master\nbamboo_repository_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nMAVEN2_HOME=C:\softwares\apache-maven-3.3.9\nbamboo_capability_system_builder_msbuild_MSBuild_v14_0__64bit_=C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe\nbamboo_resultsUrl=http://10.211.55.3:8085/browse/MUL3PRJ-MUL3PL-JOB1-9\nbamboo_capability_system_builder_msbuild_MSBuild_v4_0__32bit_=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe\nbamboo_build_working_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\nbamboo_planRepository_1_name=cicd\nbamboo_buildKey=MUL3PRJ-MUL3PL-JOB1\nbamboo_shortPlanName=mule3-cicd-example\nbamboo_inject___t_e_s_t_1_=test1\nbamboo_repository_360450_name=cicd\nbamboo_planRepository_name=cicd\n... Job\nbamboo_buildResultsUrl=http://10.211.55.3:8085/browse/MUL3PRJ-MUL3PL-JOB1-9\nbamboo_planRepository_repositoryUrl=https://bitbucket.org/krimisra24/cicd\nbamboo_agentId=196609\nbamboo_planName=mule3-cicd-example - mule3-cicd-example\nbamboo_shortPlanKey=MUL3PL\nbamboo_shortJobKey=JOB1\nbamboo_planRepository_revision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_buildTimeStamp=2018-05-01T07:04:25.579+10:00\nbamboo_repository_previous_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_3=C:\Users\krishnamisra\bamboo-home-new\temp\MUL3PRJ-MUL3PL-JOB1-9-ScriptBuildTask-4083120186627646746.ps1\nbamboo_planRepository_previousRevision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nM2_HOME=C:\softwares\apache-maven-3.3.9\nbamboo_buildResultKey=MUL3PRJ-MUL3PL-JOB1-9\nbamboo_repository_branch_name=master\nbamboo_buildPlanName=mule3-cicd-example - mule3-cicd-example - Default Job\nbamboo_inject__=\nbamboo_planRepository_1_revision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_repository_name=cicd\nJAVA_HOME=C:\Program Files\Java\jdk1.8.0_151\nbamboo_dependenciesDisabled=false\nbamboo_buildFailed=false\nbamboo_planRepository_branch=master\nbamboo_agentWorkingDirectory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\nbamboo_planRepository_1_previousRevision=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_planRepository_branchDisplayName=master\nbamboo_capability_system_jdk_JDK_1_8_0_151=C:\Program Files\Java\jdk1.8.0_151\nbamboo_planRepository_1_type=bbCloud\nbamboo_planRepository_branchName=master\nbamboo_capability_system_jdk_JDK=C:\Program Files\Java\jdk1.8.0_151\nbamboo_plan_storageTag=plan-425985\nbamboo_repository_360450_revision_number=7dfb3ab64d471cc3c706976b2ad45cdc72698a27\nbamboo_hg_cache_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\_hg-repositories-cache\nbamboo_planRepository_1_username=krimisra24\nbamboo_planRepository_type=bbCloud\nbamboo_capability_system_builder_msbuild_MSBuild_v14_0__32bit_=C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe\nbamboo_git_cache_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\_git-repositories-cache\nbamboo_ManualBuildTriggerReason_userName=admin\nbamboo_capability_system_builder_msbuild_MSBuild_v4_0__64bit_=C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe\nuseMavenReturnCode=false\nbamboo_capability_system_builder_mvn3_Maven_Executable___New=C:\softwares\apache-maven-3.3.9\nbamboo_tmp_directory=C:\Users\krishnamisra\bamboo-home-new\temp\nbamboo_working_directory=C:\Users\krishnamisra\bamboo-home-new\xml-data\build-dir\MUL3PRJ-MUL3PL-JOB1\nbamboo_capability_system_builder_mvn3_Maven_Executable=C:\maven\apache-maven-3.5.3-bin\apache-maven-3.5.3\nbamboo_planKey=MUL3PRJ-MUL3PL\nbamboo_planRepository_1_repositoryUrl=https://bitbucket.org/krimisra24/cicd\nbamboo_planRepository_username=krimisra24\nbamboo_capability_system_jdk_JDK_1_8=C:\Program Files\Java\jdk1.8.0_151\nbamboo_planRepository_1_branchName=master\nPath=C:\Program Files\Java\jdk1.8.0_151\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Java\jdk1.8.0_151\bin;C:\softwares\apache-maven-3.3.9\bin;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps\n
simple 01-May-2018 07:04:32 Failing task since return code of [C:\softwares\apache-maven-3.3.9\bin\mvn.cmd --batch-mode -Djava.io.tmpdir=C:\Program Files\Bamboo_New\temp\MUL3PRJ-MUL3PL-JOB1 -s C:/Users/krishnamisra/.m2/settings.xml -f mule3-cicd-example-api/pom.xml clean package] was -1 while expected 0
simple 01-May-2018 07:04:32 Finished task 'Maven Task' with result: Failed
simple 01-May-2018 07:04:32 Running post build plugin 'NCover Results Collector'
simple 01-May-2018 07:04:32 Running post build plugin 'Artifact Copier'
simple 01-May-2018 07:04:32 Running post build plugin 'npm Cache Cleanup'
simple 01-May-2018 07:04:32 Running post build plugin 'Clover Results Collector'
simple 01-May-2018 07:04:32 Running post build plugin 'Docker Container Cleanup'
simple 01-May-2018 07:04:32 Finalising the build...
simple 01-May-2018 07:04:32 Stopping timer.
simple 01-May-2018 07:04:32 Build MUL3PRJ-MUL3PL-JOB1-9 completed.
simple 01-May-2018 07:04:32 Running on server: post build plugin 'NCover Results Collector'
simple 01-May-2018 07:04:32 Running on server: post build plugin 'Build Hanging Detection Configuration'
simple 01-May-2018 07:04:32 Running on server: post build plugin 'Clover Delta Calculator'
simple 01-May-2018 07:04:32 Running on server: post build plugin 'Maven Dependencies Postprocessor'
simple 01-May-2018 07:04:32 All post build plugins have finished
simple 01-May-2018 07:04:32 Generating build results summary...
simple 01-May-2018 07:04:32 Saving build results to disk...
simple 01-May-2018 07:04:32 Logging substituted variables...
simple 01-May-2018 07:04:32 Indexing build results...
simple 01-May-2018 07:04:32 Finished building MUL3PRJ-MUL3PL-JOB1-9.

1 answer

0 votes
Bill Carreon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 2, 2018

Hi Krishna,

 

This sounds like the Bamboo variables may be incorrect in the task for some reason. This can be caused by using an absolute path instead of a relative one. Bamboo offers a “dump variables to log” task that can be used to confirm that the variables are being assigned as expected.

 

Regards,

Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events