Deploy Spring boot app in server
Asked by Kishore Kumar Krishnamurthy:

Hi Guys,

I need to deploy spring boot maven application to the remote server. I would like to know how this can be acheived it?

Thanks,

Kishore


Answers:
author: Jeyanthan I
body: Hi Kishore,

If your question is just about how to upload files from Bamboo directly to a remote server as part of a Bamboo job, just use the [SCP task in Bamboo](https://confluence.atlassian.com/bamboo/using-the-scp-task-in-bamboo-305759795.html).

Hope that helps.

comments: author: Kishore Kumar Krishnamurthy
body: Hi,

I got different problem. The bamboo server running with Java7 and i have few projects build in 7 and few in 8.

I tried using JDK capability for java 8 projects but bamboo not picking the right JDK.Please find the log below:

```
command 14-Aug-2017 14:59:29 Beginning to execute external process for build 'webservice-client - its-api-provider - Build #6 (WEBSERVICECLIENTS-ITSAPI-BUIL-6)'\n ... running command line: \n/usr/local/six/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/usr/local/bamboo/temp/WEBSERVICECLIENTS-ITSAPI-BUIL clean package\n ... in: /usr/local/atlassian-bamboo-data/xml-data/build-dir/WEBSERVICECLIENTS-ITSAPI-BUIL\n ... using extra environment variables: \nbamboo_deploy_target_devwas8=LPI-DEV-WAS8\nbamboo_scm_base_url=http://srv-qs-svn:18080/svn\nJAVA_HOME=/tmp/jdk8\nbamboo_deploy_target_prod=LPI-PROD-SYD\nuseMavenReturnCode=false\nbamboo_deploy_target_qa=LPI-QA-SYD\nbamboo_repository_url_snapshots=http://srv-qs-nex:8081/nexus/content/repositories/snapshots\nbamboo_websphere_sharedlib_hibernate_path=/six-hibernate\nbamboo_scm_bds_portlets_url=/portlet-applications/portlets\nbamboo_deploy_target_qa2=LPI-QA-BHS\nbamboo_scm_bds_portlet_common_url=/portlet-applications/portlet-common\nbamboo_websphere_sharedlib_dbclient_path=/six-dbclient\nbamboo_scm_portlets_url=/portlets\nbamboo_websphere_sharedlib_common_path=/six-common\nbamboo_maven_global_flags=\nMAVEN2_HOME=/usr/local/six/maven\nbamboo_websphere_sharedlib_base_path=/usr/local/WebSphere/shared-lib\nbamboo_repository_url_releases=http://srv-qs-nex:8081/nexus/content/repositories/releases\nbamboo_deploy_target_dev=LPI-DEV\nbamboo_scm_wsclient_url=/webservice-clients\nMAVEN_OPTS=-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=512m\nbamboo_scm_services_url=/services\nM2_HOME=/usr/local/six/maven\nbamboo_deploy_target_prod1=LPI-PROD-SYD\nbamboo_deploy_target_prod2=LPI-PROD-BHS\nbamboo_websphere_sharedlib_wsclient_path=/six-wsclient\nbamboo_websphere_sharedlib_filter_path=/six-filters\nbamboo_snapshots_build_command=clean deploy ${bamboo.maven.global.flags}\nbamboo_scm_common_url=/portlet-common\nbamboo_deploy_target_auth=LPI-PROD-AUTH\nbamboo_scm_servicescommon_url=/services-common\nPATH=/tmp/jdk8/bin:/sbin:/usr/sbin:/bin:/usr/bin\nerror 14-Aug-2017 14:59:29 Error: JAVA_HOME is not defined correctly.error 14-Aug-2017 14:59:29   We cannot execute /tmp/jdk8/bin/javasimple 14-Aug-2017 14:59:29 Failing task since return code of [/usr/local/six/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/usr/local/bamboo/temp/WEBSERVICECLIENTS-ITSAPI-BUIL clean package] was 1 while expected 0simple 14-Aug-2017 14:59:29 Finished task 'Clean and package the source code to jar file'simple 14-Aug-2017 14:59:29 Running post build plugin 'NCover Results Collector'simple 14-Aug-2017 14:59:29 Running post build plugin 'Clover Results Collector'simple 14-Aug-2017 14:59:29 Running post build plugin 'Artifact Copier'simple 14-Aug-2017 14:59:29 Publishing an artifact: its api providererror 14-Aug-2017 14:59:29 Unable to publish artifact [its api provider]: the source directory /usr/local/atlassian-bamboo-data/xml-data/build-dir/WEBSERVICECLIENTS-ITSAPI-BUIL/target does not exist.simple 14-Aug-2017 14:59:29 Finished publishing of artifact Shared artifact: [its api provider], pattern: [**/*.jar] anchored at: [target] in 0s
```


author: Jeyanthan I
body: Are you sure that you have defined the Java capability on your agent? [Defining a new JDK capability](https://confluence.atlassian.com/bamboo/defining-a-new-jdk-capability-289277157.html)


author: Kishore Kumar Krishnamurthy
body: I defined but still didnt work due to access restrictions on servers. I changed to Java 7 project and things are working fine.


Tags: spring-boot