1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/cmd/mavenExecute.go

33 lines
969 B
Go
Raw Normal View History

2020-02-28 14:09:46 +02:00
package cmd
import (
"github.com/SAP/jenkins-library/pkg/command"
"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/maven"
"github.com/SAP/jenkins-library/pkg/telemetry"
)
func mavenExecute(config mavenExecuteOptions, telemetryData *telemetry.CustomData) string {
c := command.Command{}
options := maven.ExecuteOptions{
PomPath: config.PomPath,
ProjectSettingsFile: config.ProjectSettingsFile,
GlobalSettingsFile: config.GlobalSettingsFile,
M2Path: config.M2Path,
Goals: config.Goals,
Defines: config.Defines,
Flags: config.Flags,
LogSuccessfulMavenTransfers: config.LogSuccessfulMavenTransfers,
ReturnStdout: config.ReturnStdout,
}
output, err := maven.Execute(&options, &c)
if err != nil {
log.Entry().WithError(err).Fatal("step execution failed")
}
return output
}