tomasdavidorg commented on code in PR #2209:
URL:
https://github.com/apache/incubator-kie-tools/pull/2209#discussion_r1559245494
##########
packages/kn-plugin-workflow/e2e-tests/helper_test.go:
##########
@@ -172,3 +172,46 @@ func CleanUpAndChdirTemp(t *testing.T) {
os.Exit(1)
}
}
+
+func AddSnapshotRepositoryDeclarationToPom(t *testing.T, projectDir string) {
+ VerifyFilesExist(t, projectDir, []string{"pom.xml"})
+ pomFilePath := filepath.Join(projectDir, "pom.xml")
+
+ file, err := os.Open(pomFilePath)
+ require.NoErrorf(t, err, "Expected nil error, got: %v", err)
+ defer file.Close()
Review Comment:
This defers the calling of the `file.Close()` at the end of this function
but we rewrite the `pom.xml` file before the end. I think this might cause some
issues.
##########
packages/kn-plugin-workflow/e2e-tests/helper_test.go:
##########
@@ -39,7 +39,7 @@ import (
// ExecuteCommand executes a command with the given arguments and returns an
error if the command fails.
func ExecuteCommand(command string, args ...string) error {
- cmd := exec.Command(command, args...)
+ cmd := exec.Command("MAVEN_ARGS=\"-B\""+command, args...)
Review Comment:
For `mvn` as `command` and `clean`, `install` as `args...`, this will create
command:
```
MAVEN_ARGS="-B"mvn clean install
```
so I think this should not work.
Also the `ExecuteCommand` function is not used for maven execution, see
https://github.com/apache/incubator-kie-tools/blob/main/packages/kn-plugin-workflow/e2e-tests/main_test.go#L180
##########
packages/kn-plugin-workflow/pkg/command/quarkus/build.go:
##########
@@ -232,7 +232,7 @@ func runBuildImage(cfg BuildCmdConfig) (out string, err
error) {
builderConfig := getBuilderConfig(cfg)
executableName := getExecutableNameConfig(cfg)
- build := common.ExecCommand("mvn", "package",
+ build := common.ExecCommand("mvn", "-B","package",
Review Comment:
```suggestion
build := common.ExecCommand("mvn", "-B", "package",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]