简体   繁体   中英

How to run the jar located on remote server

I've managed to build my source from git and put it into S3. Now, I want to run this jar in the post-build phase. The jar is located on S3 as well inside a public bucket, having a read-permission by all. I've began with a simple hello-world.jar , but when I add this to to the code-build's configuration:

post_build:
commands:
   - java -jar https://s3.amazonaws.com/*****/hello-world-test-1.0-SNAPSHOT.jar

I'm getting following error message in the post build phase:

Error while executing command: java -jar https://s3.amazonaws.com/*******/hello-world-test-1.0-SNAPSHOT.jar. Reason: exit status 1

What did I missed? Is it possible to run a jar which is located at remote server ?

You could use one of the jar-related API mentioned in documentation

java JarRunner url [arguments]

So,

java JarRunner https://s3.amazonaws.com/*****/hello-world-test-1.0-SNAPSHOT.jar

Assuming your jar has Main-Class defined in manifest file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM