You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/03/10 17:11:43 UTC

[camel-k] 08/09: Fix project generation for quarkus

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 2dc57b7189310ecd04fdc9997c83d171cab6a1da
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Tue Mar 10 09:03:04 2020 +0100

    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 ab920a5..538474f 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 {