From 2dc57b7189310ecd04fdc9997c83d171cab6a1da Mon Sep 17 00:00:00 2001 From: lburgazzoli Date: Tue, 10 Mar 2020 09:03:04 +0100 Subject: [PATCH] Fix project generation for quarkus --- pkg/builder/runtime/quarkus.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/builder/runtime/quarkus.go b/pkg/builder/runtime/quarkus.go index ab920a564f..538474f4ed 100644 --- a/pkg/builder/runtime/quarkus.go +++ b/pkg/builder/runtime/quarkus.go @@ -20,6 +20,7 @@ package runtime import ( "fmt" "io/ioutil" + "os" "path" yaml2 "gopkg.in/yaml.v2" @@ -118,6 +119,21 @@ func buildQuarkusRunner(ctx *builder.Context) error { mc.LocalRepository = ctx.Build.Maven.LocalRepository mc.Timeout = ctx.Build.Maven.GetTimeout().Duration + resourcesPath := path.Join(mc.Path, "src", "main", "resources") + if err := os.MkdirAll(resourcesPath, os.ModePerm); err != nil { + return errors.Wrap(err, "failure while creating resource folder") + } + + // generate an empty application.properties so that there will be something in + // target/classes as if such directory does not exist, the quarkus maven plugin + // mai fail the build + // + // in the future there should be a way to provide build information from secrets, + // configmap, etc. + if _, err := os.Create(path.Join(resourcesPath, "application.properties")); err != nil { + return errors.Wrap(err, "failure while creating application.properties") + } + // Build the project mc.AddArgument("package") if err := maven.Run(mc); err != nil {