Giter VIP home page Giter VIP logo

java-function-buildpack's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ekcasey avatar ericbottard avatar fbiville avatar github-actions[bot] avatar nebhale avatar scothis avatar trisberg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

java-function-buildpack's Issues

Unable to build plain Java app that uses Maven's shade plugin

I have a plain Java function that has a required dependency and to include that I use the shade plugin for Maven.

The build fails with the following error:

unable to determine built artifact in /workspace/app/target, candidates: [/workspace/app/target/capitalize-java-0.0.1.jar /workspace/app/target/original-capitalize-java-0.0.1.jar]

2018/12/07 00:10:47 Error: failed to : exit status 103
Error: failed with status code: 7

Tweak command line and update invoker to Spring Boot 2.2

Default command line defined in this buildpack:

$ FUNCTION_URI=file:///workspace java -cp /layers/io.projectriff.java/riff-invoker-java/ org.springframework.boot.loader.JarLauncher
...
INFO: Started application in 4.117 seconds (JVM running for 5.107)

Tweaked:

$ FUNCTION_URI=file:///workspace java -Dspring.jmx.enabled=false -Dspring.config.location=file:///layers/io.projectriff.java/riff-invoker-java/BOOT-INF/classes/application.properties -noverify -XX:TieredStopAtLevel=1 -cp /layers/io.projectriff.java/riff-invoker-java:/layers/io.projectriff.java/riff-invoker-java/BOOT-INF/classes:`echo /layers/io.projectriff.java/riff-invoker-java/BOOT-INF/lib/*.jar | tr ' ' ':'` io.projectriff.invoker.JavaFunctionInvokerApplication
[2019-09-04 13:02:43.201] - 513 INFO [Thread-1] --- org.springframework.boot.SpringApplication: Started application in 1.538 seconds (JVM running for 1.935)

And updated to Spring Boot 2.2:

$ FUNCTION_URI=file:///workspace java -Dspring.main.lazy-initialization=true -Dspring.jmx.enabled=false -Dspring.config.location=file:///layers/io.projectriff.java/riff-invoker-java/BOOT-INF/classes/application.properties -noverify -XX:TieredStopAtLevel=1 -cp $CP io.projectriff.invoker.JavaFunctionInvokerApplication
...
[2019-09-04 12:54:52.147] - 446 INFO [Thread-1] --- org.springframework.boot.SpringApplication: Started application in 1.114 seconds (JVM running for 1.514)

It would probably be faster with Java 8. Maybe that ought to be an option (since it is supported with the openjdk buildpack it probably already is if you know how to tweak the build)?

Most of the boost comes from -noverify which the JVM purists don't like. We could also probably remove the -noverify for the sake of cleanliness if we used JDK 11 and App CDS (expect similar cold start times). Requires more munging of the invoker artifact (and maybe should be a feature of the openjdk build pack).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.