Skip to content

Commit

Permalink
Fix project generation for quarkus
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Mar 10, 2020
1 parent 82cd8e1 commit 2dc57b7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/builder/runtime/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package runtime
import (
"fmt"
"io/ioutil"
"os"
"path"

yaml2 "gopkg.in/yaml.v2"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2dc57b7

Please sign in to comment.