diff --git a/README.md b/README.md index e0c2ab5..91f3ebc 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ The buildpack will do the following if a JRE is requested: | `$BPL_DEBUG_SUSPEND` | Configure whether to suspend execution until a debugger has attached. Defaults to `false`. | `$BPL_JFR_ENABLED` | Configure whether Java Flight Recording (JFR) is enabled. If no arguments are specified via `BPL_JFR_ARGS`, the default config args `dumponexit=true,filename=/tmp/recording.jfr` are added. | `$BPL_JFR_ARGS` | Configure custom arguments to Java Flight Recording, via a comma-separated list, e.g. `duration=10s,maxage=1m`. If any values are specified, no default args are supplied. +| `$BP_JVM_JLINK_ENABLED` | Configures whether to run the JDK's jlink tool at build time to generate a custom JRE. Defaults to `false`. If no custom args are specified, the default args are `--no-man-pages --no-header-files --strip-debug --compress=1`. +| `$BP_JVM_JLINK_ARGS` | Configure custom arguments to supply to the jlink tool. If any custom args are specified, no default args are supplied. | `$JAVA_TOOL_OPTIONS` | Configure the JVM launch flags | [bpv]: https://github.com/paketo-buildpacks/alibaba-dragonwell/releases diff --git a/buildpack.toml b/buildpack.toml index 024bf44..0a52f7c 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -103,6 +103,18 @@ api = "0.7" launch = true name = "BPL_JFR_ARGS" + [[metadata.configurations]] + default = "false" + description = "enables running jlink tool to generate custom JRE" + build = true + name = "BP_JVM_JLINK_ENABLED" + + [[metadata.configurations]] + default = "--no-man-pages --no-header-files --strip-debug --compress=1" + description = "configure custom link arguments (--output must be omitted)" + build = true + name = "BP_JVM_JLINK_ARGS" + [[metadata.configurations]] default = "" description = "write heap dumps on error to this path" diff --git a/cmd/main/main.go b/cmd/main/main.go index 1712f66..31d26ea 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -34,6 +34,6 @@ func main() { _ = helper.ActiveProcessorCount{Logger: logger} libpak.Main( libjvm.Detect{}, - libjvm.Build{Logger: bard.NewLogger(os.Stdout)}, + libjvm.NewBuild(logger), ) } diff --git a/go.mod b/go.mod index efa6b8e..4fb5cf3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/paketo-buildpacks/alibaba-dragonwell/v2 go 1.17 require ( - github.com/paketo-buildpacks/libjvm v1.37.0 + github.com/paketo-buildpacks/libjvm v1.38.0 github.com/paketo-buildpacks/libpak v1.60.1 ) @@ -19,7 +19,7 @@ require ( github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect - github.com/miekg/dns v1.1.49 // indirect + github.com/miekg/dns v1.1.50 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/onsi/gomega v1.19.0 // indirect github.com/pavel-v-chernykh/keystore-go/v4 v4.3.0 // indirect diff --git a/go.sum b/go.sum index 3b79735..bb598b3 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/miekg/dns v1.1.49 h1:qe0mQU3Z/XpFeE+AEBo2rqaS1IPBJ3anmqZ4XiZJVG8= -github.com/miekg/dns v1.1.49/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= +github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= +github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -63,10 +63,12 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/paketo-buildpacks/libjvm v1.37.0 h1:wzuSf5p/fjO2tn8KvEE6RT+Z7KhFp5SZUUwvKX7BjQE= -github.com/paketo-buildpacks/libjvm v1.37.0/go.mod h1:byHYhEv4l3Shn+/vOZ20jItJWv9iDWfdLY6fgLPz8e8= +github.com/paketo-buildpacks/libjvm v1.38.0 h1:tDIVUSDdibrmY9es4+8C4RbQ8SZ14jkbjiLEV2yZH/U= +github.com/paketo-buildpacks/libjvm v1.38.0/go.mod h1:R5B0MdLESY/CSrMC9Xpz1TtLnEvnrUZ4KAdW0OWUqow= github.com/paketo-buildpacks/libpak v1.60.1 h1:VSwGTxXIODXAKvv43QI6n+FgVVo0tRDP5g090BKLtMM= github.com/paketo-buildpacks/libpak v1.60.1/go.mod h1:vryAkvs1BKsy+9++Lh1y9kquWlTFBGzPTUuvs2Ta90I= +github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible h1:Jd6xfriVlJ6hWPvYOE0Ni0QWcNTLRehfGPFxr3eSL80= +github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible/go.mod h1:xlUlxe/2ItGlQyMTstqeDv9r3U4obH7xYd26TbDQutY= github.com/pavel-v-chernykh/keystore-go/v4 v4.3.0 h1:TVckDDIKzWo9/cPdsvyikdmnnKIPeWgnGoekhQM5zBc= github.com/pavel-v-chernykh/keystore-go/v4 v4.3.0/go.mod h1:VxOBKEAW8/EJjil9qwfvVDSljDW0DCoZMD4ezsq9n8U= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -77,12 +79,14 @@ github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -165,5 +169,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=