Not able to build the application
Asked by Kishore Kumar Krishnamurthy:

Hi Guys,

I'm trying to build the maven application, but i am getting following error

Log:

```
08-Nov-2017 12:02:38 Build Common libraries - client-common-libs - Build #5 (CL-CCL-JOB1-5) started building on agent Default Agent
08-Nov-2017 12:02:38 
08-Nov-2017 12:02:38 Build working directory is /usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1
08-Nov-2017 12:02:38 Executing build Common libraries - client-common-libs - Build #5 (CL-CCL-JOB1-5)
08-Nov-2017 12:02:38 Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
08-Nov-2017 12:02:38 Build always requires a clean checkout
08-Nov-2017 12:02:38 Cleaning build directory '/usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1'
08-Nov-2017 12:02:38 Updating source code to revision: 9907
08-Nov-2017 12:02:38 Working directory '/usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1' is empty. Checking out SVN URL 'http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk'
08-Nov-2017 12:02:40 Updated source code to revision: 9907
08-Nov-2017 12:02:40 Finished task 'Checkout Default Repository' with result: Success
08-Nov-2017 12:02:40 Running pre-build action: VCS Version Collector
08-Nov-2017 12:02:40 Starting task 'Clean and package the source code to jar file' of type 'com.atlassian.bamboo.plugins.maven:task.builder.mvn3'
08-Nov-2017 12:02:40 
Beginning to execute external process for build 'Common libraries - client-common-libs - Build #5 (CL-CCL-JOB1-5)'
 ... running command line: 
/build-libs/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/usr/local/bamboo/temp/CL-CCL-JOB1 clean package install
 ... in: /usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1
 ... using extra environment variables: 
bamboo_planRepository_1_rootUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_repository_720902_svn_repositoryUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_planRepository_1_branchDisplayName=trunk
bamboo_repository_revision_number=9907
MAVEN2_HOME=/build-libs/maven
bamboo_resultsUrl=http://srv-qs-kboop:8085/browse/CL-CCL-JOB1-5
bamboo_repository_720902_branch_name=trunk
bamboo_capability_system_jdk_JDK_1_8_0_31=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64
bamboo_planRepository_1_name=client-common-libs
bamboo_capability_system_builder_command_Gradle=/build-libs/gradle
bamboo_build_working_directory=/usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1
bamboo_buildKey=CL-CCL-JOB1
bamboo_repository_720902_revision_number=9907
bamboo_planRepository_1_branchPath=
bamboo_shortPlanName=client-common-libs
bamboo_repository_720902_svn_branchName=trunk
bamboo_planRepository_name=client-common-libs
bamboo_repository_svn_username=bamboo
bamboo_buildNumber=5
bamboo_shortJobName=Build
bamboo_buildResultsUrl=http://srv-qs-kboop:8085/browse/CL-CCL-JOB1-5
bamboo_planRepository_url=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_planRepository_repositoryUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_agentId=196609
bamboo_planName=Common libraries - client-common-libs
bamboo_shortPlanKey=CCL
bamboo_repository_720902_svn_rootUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_shortJobKey=JOB1
bamboo_repository_720902_svn_branchPath=
bamboo_planRepository_revision=9907
bamboo_repository_previous_revision_number=9907
bamboo_buildTimeStamp=2017-11-08T12:02:38.272+11:00
bamboo_planRepository_previousRevision=9907
bamboo_repository_svn_branchPath=
M2_HOME=/build-libs/maven
bamboo_planRepository_branchPath=
bamboo_buildResultKey=CL-CCL-JOB1-5
bamboo_repository_branch_name=trunk
bamboo_buildPlanName=Common libraries - client-common-libs - Build
bamboo_planRepository_1_revision=9907
bamboo_repository_720902_svn_username=bamboo
bamboo_repository_720902_name=client-common-libs
bamboo_repository_name=client-common-libs
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64
bamboo_dependenciesDisabled=false
bamboo_repository_720902_svn_url=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_buildFailed=false
bamboo_repository_720902_previous_revision_number=9907
MAVEN_OPTS=-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=512m
bamboo_agentWorkingDirectory=/usr/local/atlassian-bamboo-data/xml-data/build-dir
bamboo_planRepository_1_previousRevision=9907
bamboo_repository_svn_branchName=trunk
bamboo_planRepository_rootUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_planRepository_branchDisplayName=trunk
bamboo_planRepository_1_type=svnv2
bamboo_planRepository_branchName=trunk
bamboo_planRepository_1_url=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_capability_system_builder_mvn3_Maven=/build-libs/maven
bamboo_repository_svn_url=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64
bamboo_plan_storageTag=plan-851974
bamboo_planRepository_type=svnv2
bamboo_planRepository_1_username=bamboo
bamboo_ManualBuildTriggerReason_userName=kkrishnamurthy
useMavenReturnCode=false
bamboo_capability_system_builder_ant_Ant=/build-libs/ant
bamboo_working_directory=/usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1
bamboo_planKey=CL-CCL
bamboo_planRepository_1_repositoryUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_planRepository_username=bamboo
bamboo_repository_svn_rootUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64
bamboo_repository_svn_repositoryUrl=http://srv-qs-svn:18080/svn/portlet-applications/ecom-microservices/client-common-libs/trunk
bamboo_planRepository_1_branchName=trunk
PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64/bin:/sbin:/usr/sbin:/bin:/usr/bin
08-Nov-2017 12:02:40 Failing task since return code of [/build-libs/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/usr/local/bamboo/temp/CL-CCL-JOB1 clean package install] was -1 while expected 0
08-Nov-2017 12:02:40 Parsing test results under /usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1...
08-Nov-2017 12:02:40 Finished task 'Clean and package the source code to jar file' with result: Failed
08-Nov-2017 12:02:40 Running post build plugin 'NCover Results Collector'
08-Nov-2017 12:02:40 Running post build plugin 'Artifact Copier'
08-Nov-2017 12:02:40 Publishing an artifact: client common library
08-Nov-2017 12:02:40 Unable to publish artifact [client common library]: the source directory /usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1/target does not exist.
08-Nov-2017 12:02:40 The artifact hasn't been successfully published after 290.9 ?s
08-Nov-2017 12:02:40 Running post build plugin 'npm Cache Cleanup'
08-Nov-2017 12:02:40 Running post build plugin 'Clover Results Collector'
08-Nov-2017 12:02:40 Running post build plugin 'Docker Container Cleanup'
08-Nov-2017 12:02:40 Finalising the build...
08-Nov-2017 12:02:40 Stopping timer.
08-Nov-2017 12:02:40 Build CL-CCL-JOB1-5 completed.
08-Nov-2017 12:02:40 Running on server: post build plugin 'NCover Results Collector'
08-Nov-2017 12:02:40 Running on server: post build plugin 'Build Hanging Detection Configuration'
08-Nov-2017 12:02:40 Running on server: post build plugin 'Clover Delta Calculator'
08-Nov-2017 12:02:40 Running on server: post build plugin 'Maven Dependencies Postprocessor'
08-Nov-2017 12:02:40 All post build plugins have finished
08-Nov-2017 12:02:40 Generating build results summary...
08-Nov-2017 12:02:40 Saving build results to disk...
08-Nov-2017 12:02:40 Logging substituted variables...
08-Nov-2017 12:02:40 Indexing build results...
08-Nov-2017 12:02:40 Finished building CL-CCL-JOB1-5.
```

Any help would be much appreciated.

Thanks,

Kris


Answers:
author: Nic Brough -Adaptavist-
body: There is no error there?

comments: author: Kishore Kumar Krishnamurthy
body: ```
08-Nov-2017 12:02:40 Unable to publish artifact [client common library]: the source directory /usr/local/atlassian-bamboo-data/xml-data/build-dir/CL-CCL-JOB1/target does not exist.
```


author: Sergio Diaz
body: Hi Kishore,

When you create your artifact, make sure that you remove the word target in location, by default will create the artifacts in the ...\\bamboo-home\\artifacts\\ depending if you want to share them.


author: Kishore Kumar Krishnamurthy
body: I did fix this issue by mapping current folder structure to copy the artifacts. I appreciate your time and answer. Thank you


Tags: maven