From 5a25af8a67e185d5272af8b7f4a44bea3e66ecf1 Mon Sep 17 00:00:00 2001 From: David O'Sullivan Date: Mon, 2 Oct 2023 10:24:20 +0100 Subject: [PATCH] uses dependency URI instead of cache artifact name for classpath --- tomee/base.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tomee/base.go b/tomee/base.go index 3fc397c..25f4c29 100644 --- a/tomee/base.go +++ b/tomee/base.go @@ -200,9 +200,9 @@ func (b Base) ContributeAccessLogging(layer libcnb.Layer) error { b.Logger.Bodyf("Copying to %s/lib", layer.Path) - file := filepath.Join(layer.Path, "lib", filepath.Base(artifact.Name())) + file := filepath.Join(layer.Path, "lib", filepath.Base(b.AccessLoggingDependency.URI)) if err := sherpa.CopyFile(artifact, file); err != nil { - return fmt.Errorf("unable to copy %s to %s\n%w", artifact.Name(), file, err) + return fmt.Errorf("unable to copy %s to %s\n%w", filepath.Base(b.AccessLoggingDependency.URI), file, err) } return nil @@ -333,9 +333,9 @@ func (b Base) ContributeLifecycle(layer libcnb.Layer) error { b.Logger.Bodyf("Copying to %s/lib", layer.Path) - file := filepath.Join(layer.Path, "lib", filepath.Base(artifact.Name())) + file := filepath.Join(layer.Path, "lib", filepath.Base(b.LifecycleDependency.URI)) if err := sherpa.CopyFile(artifact, file); err != nil { - return fmt.Errorf("unable to copy %s to %s\n%w", artifact.Name(), file, err) + return fmt.Errorf("unable to copy %s to %s\n%w", filepath.Base(b.LifecycleDependency.URI), file, err) } return nil @@ -352,9 +352,9 @@ func (b Base) ContributeLogging(layer libcnb.Layer) error { b.Logger.Bodyf("Copying to %s/bin", layer.Path) - file := filepath.Join(layer.Path, "bin", filepath.Base(artifact.Name())) + file := filepath.Join(layer.Path, "bin", filepath.Base(b.LoggingDependency.URI)) if err := sherpa.CopyFile(artifact, file); err != nil { - return fmt.Errorf("unable to copy %s to %s\n%w", artifact.Name(), file, err) + return fmt.Errorf("unable to copy %s to %s\n%w", filepath.Base(b.LoggingDependency.URI), file, err) } b.Logger.Bodyf("Writing %s/bin/setenv.sh", layer.Path)