Skip to content

Commit

Permalink
Merge pull request #67 from paketo-buildpacks/gh_issue_66
Browse files Browse the repository at this point in the history
Spring should not be required when using Native Image buildpack
  • Loading branch information
Daniel Mikusa authored May 13, 2021
2 parents 54a8c5b + feee7d4 commit f4ba321
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
7 changes: 1 addition & 6 deletions native/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) {
return libcnb.BuildResult{}, fmt.Errorf("unable to read manifest in %s\n%w", context.Application.Path, err)
}

_, ok := manifest.Get("Spring-Boot-Version")
if !ok {
return libcnb.BuildResult{}, nil
}

cr, err := libpak.NewConfigurationResolver(context.Buildpack, &b.Logger)
if err != nil {
return libcnb.BuildResult{}, fmt.Errorf("unable to create configuration resolver\n%w", err)
}
if _, ok = cr.Resolve(DeprecatedConfigNativeImage); ok {
if _, ok := cr.Resolve(DeprecatedConfigNativeImage); ok {
b.warn(fmt.Sprintf("$%s has been deprecated. Please use $%s instead.",
DeprecatedConfigNativeImage,
ConfigNativeImage,
Expand Down
14 changes: 0 additions & 14 deletions native/native_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/buildpacks/libcnb"
Expand Down Expand Up @@ -164,16 +163,3 @@ func (n NativeImage) Contribute(layer libcnb.Layer) (libcnb.Layer, error) {
func (NativeImage) Name() string {
return "native-image"
}

func (NativeImage) hasSpringNative(libs []string) bool {
// matches either spring-native or legacy spring-graalvm-native
re := regexp.MustCompile(`spring-(?:graalvm-|)native-.+\.jar`)

for _, l := range libs {
if re.MatchString(l) {
return true
}
}

return false
}

0 comments on commit f4ba321

Please sign in to comment.