Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func MvnCmd(c *cli.Context) (err error) {
}
// Create Maven command with empty config for FlexPack
mvnCmd := mvn.NewMvnCommand().SetConfigPath("").SetGoals(filteredMavenArgs).SetConfiguration(buildConfiguration)
return commands.Exec(mvnCmd)
return commands.ExecWithPackageManager(mvnCmd, project.Maven.String())
}

// If config file is missing and not in native mode, return the standard missing-config error.
Expand Down Expand Up @@ -729,7 +729,7 @@ func MvnCmd(c *cli.Context) (err error) {
}
}
mvnCmd := mvn.NewMvnCommand().SetConfiguration(buildConfiguration).SetConfigPath(configFilePath).SetGoals(filteredMavenArgs).SetThreads(threads).SetInsecureTls(insecureTls).SetDetailedSummary(detailedSummary || printDeploymentView).SetXrayScan(xrayScan).SetScanOutputFormat(scanOutputFormat)
err = commands.Exec(mvnCmd)
err = commands.ExecWithPackageManager(mvnCmd, project.Maven.String())
result := mvnCmd.Result()
defer cliutils.CleanupResult(result, &err)
err = cliutils.PrintCommandSummary(mvnCmd.Result(), detailedSummary, printDeploymentView, false, err)
Expand Down Expand Up @@ -789,7 +789,7 @@ func GradleCmd(c *cli.Context) (err error) {

// Create Gradle command with FlexPack (no config file needed)
gradleCmd := gradle.NewGradleCommand().SetConfiguration(buildConfiguration).SetTasks(filteredGradleArgs).SetConfigPath("").SetServerDetails(serverDetails)
return commands.Exec(gradleCmd)
return commands.ExecWithPackageManager(gradleCmd, project.Gradle.String())
}

// If config file is missing and not in native mode, return the standard missing-config error.
Expand Down Expand Up @@ -841,7 +841,7 @@ func GradleCmd(c *cli.Context) (err error) {
}
printDeploymentView := log.IsStdErrTerminal()
gradleCmd := gradle.NewGradleCommand().SetConfiguration(buildConfiguration).SetTasks(filteredGradleArgs).SetConfigPath(configFilePath).SetThreads(threads).SetDetailedSummary(detailedSummary || printDeploymentView).SetXrayScan(xrayScan).SetScanOutputFormat(scanOutputFormat)
err = commands.Exec(gradleCmd)
err = commands.ExecWithPackageManager(gradleCmd, project.Gradle.String())
result := gradleCmd.Result()
defer cliutils.CleanupResult(result, &err)
err = cliutils.PrintCommandSummary(gradleCmd.Result(), detailedSummary, printDeploymentView, false, err)
Expand All @@ -863,7 +863,7 @@ func YarnCmd(c *cli.Context) error {
}

yarnCmd := yarn.NewYarnCommand().SetConfigFilePath(configFilePath).SetArgs(c.Args())
return commands.Exec(yarnCmd)
return commands.ExecWithPackageManager(yarnCmd, project.Yarn.String())
}

func pnpmCmd(c *cli.Context) error {
Expand All @@ -889,7 +889,7 @@ func pnpmCmd(c *cli.Context) error {
if err != nil {
return err
}
return commands.Exec(pnpmCommand)
return commands.ExecWithPackageManager(pnpmCommand, project.Pnpm.String())
default:
return runNativePackageManagerCmd("pnpm", append([]string{cmdName}, cleanArgs...))
}
Expand Down Expand Up @@ -964,7 +964,7 @@ func NugetCmd(c *cli.Context) error {
if len(filteredNugetArgs) > 1 {
nugetCmd.SetArgAndFlags(filteredNugetArgs[1:])
}
return commands.Exec(nugetCmd)
return commands.ExecWithPackageManager(nugetCmd, project.Nuget.String())
}

func DotnetCmd(c *cli.Context) error {
Expand Down Expand Up @@ -1008,7 +1008,7 @@ func DotnetCmd(c *cli.Context) error {
if len(filteredDotnetArgs) > 1 {
dotnetCmd.SetArgAndFlags(filteredDotnetArgs[1:])
}
return commands.Exec(dotnetCmd)
return commands.ExecWithPackageManager(dotnetCmd, project.Dotnet.String())
}

func getNugetAndDotnetConfigFields(configFilePath string) (rtDetails *coreConfig.ServerDetails, targetRepo string, useNugetV2 bool, err error) {
Expand Down Expand Up @@ -1058,7 +1058,7 @@ func GoCmd(c *cli.Context) error {
args := cliutils.ExtractCommand(c)
goCommand := golang.NewGoCommand()
goCommand.SetConfigFilePath(configFilePath).SetGoArg(args)
return commands.Exec(goCommand)
return commands.ExecWithPackageManager(goCommand, project.Go.String())
}

func GoPublishCmd(c *cli.Context) (err error) {
Expand All @@ -1077,7 +1077,7 @@ func GoPublishCmd(c *cli.Context) (err error) {
printDeploymentView, detailedSummary := log.IsStdErrTerminal(), c.Bool("detailed-summary")
goPublishCmd := golang.NewGoPublishCommand()
goPublishCmd.SetConfigFilePath(configFilePath).SetBuildConfiguration(buildConfiguration).SetVersion(version).SetDetailedSummary(detailedSummary || printDeploymentView).SetExcludedPatterns(cliutils.GetStringsArrFlagValue(c, "exclusions"))
err = commands.Exec(goPublishCmd)
err = commands.ExecWithPackageManager(goPublishCmd, project.Go.String())
result := goPublishCmd.Result()
defer cliutils.CleanupResult(result, &err)
err = cliutils.PrintCommandSummary(goPublishCmd.Result(), detailedSummary, printDeploymentView, false, err)
Expand Down Expand Up @@ -1204,7 +1204,7 @@ func pullCmd(c *cli.Context, image string) error {
if !supported {
return cliutils.NotSupportedNativeDockerCommand("docker-pull")
}
return commands.Exec(PullCommand)
return commands.ExecWithPackageManager(PullCommand, project.Docker.String())
}

func pushCmd(c *cli.Context, image string) (err error) {
Expand All @@ -1228,7 +1228,7 @@ func pushCmd(c *cli.Context, image string) (err error) {
if !supported {
return cliutils.NotSupportedNativeDockerCommand("docker-push")
}
err = commands.Exec(pushCommand)
err = commands.ExecWithPackageManager(pushCommand, project.Docker.String())
result := pushCommand.Result()
defer cliutils.CleanupResult(result, &err)
err = cliutils.PrintCommandSummary(pushCommand.Result(), detailedSummary, printDeploymentView, false, err)
Expand Down Expand Up @@ -1266,7 +1266,7 @@ func buildCmd(c *cli.Context) error {
buildCommand := container.NewBuildCommand(cleanArgs).SetDockerBuildOptions(dockerOptions).SetBuildConfiguration(buildConfiguration)
buildCommand.SetServerDetails(rtDetails)

return commands.Exec(buildCommand)
return commands.ExecWithPackageManager(buildCommand, project.Docker.String())
}

func loginCmd(c *cli.Context) error {
Expand Down Expand Up @@ -1382,7 +1382,7 @@ func huggingFaceUploadCmd(c *cli.Context) error {
SetRevision(revision).
SetServerDetails(serverDetails).
SetBuildConfiguration(buildConfiguration)
return commands.Exec(cmd)
return commands.ExecWithPackageManager(cmd, "huggingface")
}

func huggingFaceDownloadCmd(c *cli.Context) error {
Expand Down Expand Up @@ -1432,7 +1432,7 @@ func huggingFaceDownloadCmd(c *cli.Context) error {
SetEtagTimeout(etagTimeout).
SetServerDetails(serverDetails).
SetBuildConfiguration(buildConfiguration)
return commands.Exec(cmd)
return commands.ExecWithPackageManager(cmd, "huggingface")
}

// validateFolderHasUploadableFiles walks the folder recursively and returns an error
Expand Down Expand Up @@ -1738,7 +1738,7 @@ func npmGenericCmd(c *cli.Context, cmdName string, collectBuildInfoIfRequested b
if err = npmCmd.Init(); err != nil {
return err
}
return commands.Exec(npmCmd)
return commands.ExecWithPackageManager(npmCmd, project.Npm.String())
}

func NpmPublishCmd(c *cli.Context) (err error) {
Expand All @@ -1764,7 +1764,7 @@ func NpmPublishCmd(c *cli.Context) (err error) {
if !detailedSummary {
npmCmd.SetDetailedSummary(printDeploymentView)
}
err = commands.Exec(npmCmd)
err = commands.ExecWithPackageManager(npmCmd, project.Npm.String())
result := npmCmd.Result()
defer cliutils.CleanupResult(result, &err)
err = cliutils.PrintCommandSummary(npmCmd.Result(), detailedSummary, printDeploymentView, false, err)
Expand Down Expand Up @@ -1803,7 +1803,7 @@ func setupCmd(c *cli.Context) (err error) {
}
}
setupCmd.SetServerDetails(artDetails).SetRepoName(repoName).SetProjectKey(cliutils.GetProject(c))
return commands.Exec(setupCmd)
return commands.ExecWithPackageManager(setupCmd, packageManager.String())
}

// validateRepoExists checks if the specified repository exists in Artifactory.
Expand Down Expand Up @@ -1893,7 +1893,7 @@ func UvCmd(c *cli.Context) error {
if cmdName == "help" || cmdName == "" {
return uvCommand.Run()
}
return commands.Exec(uvCommand)
return commands.ExecWithPackageManager(uvCommand, project.UV.String())
}

// HelmCmd executes Helm commands with build info collection support
Expand Down Expand Up @@ -1938,7 +1938,7 @@ func HelmCmd(c *cli.Context) error {
SetWorkingDirectory(workingDir).
SetHelmCmdName(cmdName)

return commands.Exec(helmCmd)
return commands.ExecWithPackageManager(helmCmd, project.Helm.String())
}

// extractRepositoryCacheFromArgs extracts the --repository-cache flag value from Helm command arguments
Expand Down Expand Up @@ -2022,7 +2022,7 @@ func ConanCmd(c *cli.Context) error {
// Use jfrog-cli-artifactory Conan command with build info support
conanCommand := conancommand.NewConanCommand().SetCommandName(cmdName).SetArgs(conanArgs).SetBuildConfiguration(buildConfiguration)

return commands.Exec(conanCommand)
return commands.ExecWithPackageManager(conanCommand, project.Conan.String())
}

func NixCmd(c *cli.Context) error {
Expand Down Expand Up @@ -2069,7 +2069,7 @@ func NixCmd(c *cli.Context) error {
cmd.SetServerDetails(serverDetails)
}

return commands.Exec(cmd)
return commands.ExecWithPackageManager(cmd, "nix")
}

func pythonCmd(c *cli.Context, projectType project.ProjectType) error {
Expand Down Expand Up @@ -2165,15 +2165,15 @@ func pythonCmd(c *cli.Context, projectType project.ProjectType) error {
case project.Pip:
pipCommand := python.NewPipCommand()
pipCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pipCommand)
return commands.ExecWithPackageManager(pipCommand, project.Pip.String())
case project.Pipenv:
pipenvCommand := python.NewPipenvCommand()
pipenvCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pipenvCommand)
return commands.ExecWithPackageManager(pipenvCommand, project.Pipenv.String())
case project.Poetry:
poetryCommand := python.NewPoetryCommand()
poetryCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(poetryCommand)
return commands.ExecWithPackageManager(poetryCommand, project.Poetry.String())
default:
return errorutils.CheckErrorf("%s is not supported", projectType)
}
Expand Down Expand Up @@ -2212,7 +2212,7 @@ func terraformPublishCmd(configFilePath string, args []string, c *cli.Context) e
if err := terraformCmd.Init(); err != nil {
return err
}
err := commands.Exec(terraformCmd)
err := commands.ExecWithPackageManager(terraformCmd, project.Terraform.String())
result := terraformCmd.Result()
return cliutils.PrintBriefSummaryReport(result.SuccessCount(), result.FailCount(), cliutils.IsFailNoOp(c), err)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ require (

//replace github.com/ktrysmt/go-bitbucket => github.com/ktrysmt/go-bitbucket v0.9.80

// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260416054314-f941180fccc3
replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260604090426-c24f4507e1e6

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.13.1-0.20260428071432-1e9d9a1991ad

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260518123155-036d9195c4e9
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260604085947-7c110b77b4b4

//replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.54.2-0.20251007084958-5eeaa42c31a6
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64 h1:bxcy1v1LXQV4T0kVU1duWQr3h7vKfHyMD1B+IuFLWUw=
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64/go.mod h1:cKqb/JgN+XuD4RhOxvSZnyGyXw3cJsTZfQT3rk9MCho=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260603105750-3886c0f01286 h1:IF9Fyhfd7hilnuHO2AezV3lE9SF2FSxRxs4gfcU3f1U=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260603105750-3886c0f01286/go.mod h1:GQEGVW3wT1XPykXNsEiPQrF8/+01JvDVcGGYb5vqJuE=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260601130310-8d52a530da18 h1:tPv7XscDFAZaijVwMQNb+HmuucUMYQdjuA5frdGzhF0=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260601130310-8d52a530da18/go.mod h1:9R90mhbczGXwW5EGlDs7F08ejQU/xdoDhYHMvzBiqgE=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260604090426-c24f4507e1e6 h1:c2LVapX1OJk9+qV3/sLkVMQTgfa7q6e9+eHQbNy4rf0=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260604090426-c24f4507e1e6/go.mod h1:9T+Ifxc1TtfX2rvMn+QPHnmTrr99aXp7/Hlr9EvFsNE=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260604085947-7c110b77b4b4 h1:10kXhD3aWj4Jd6o7BBLzC/eQDelyZjcWEWnbXbL5+eI=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260604085947-7c110b77b4b4/go.mod h1:9R90mhbczGXwW5EGlDs7F08ejQU/xdoDhYHMvzBiqgE=
github.com/jfrog/jfrog-cli-evidence v0.9.5-0.20260601141509-8df6c9a4bc9b h1:V0FxnU3xh29y8yJHWymm6rPr1MrjG1DdPQlr3ckImwk=
github.com/jfrog/jfrog-cli-evidence v0.9.5-0.20260601141509-8df6c9a4bc9b/go.mod h1:t2luv7YHtrKe/Yf1xLZgLOkkiPtk1DsKj0OLXL2GwYo=
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260601140139-4cefb6add7b7 h1:wqOk6luH2NFVhK+3p7DyHCa0e5Prie4QQpo5hPyCFwI=
Expand Down
Loading
Loading