Skip to content

Commit 0ef65b4

Browse files
committed
Resoleved comments
1 parent 1f91b98 commit 0ef65b4

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ require (
245245
sigs.k8s.io/yaml v1.6.0 // indirect
246246
)
247247

248-
replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20250923185138-4c44f2898e2d
248+
replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20250924104816-8f9261b993f4
249249

250250
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.59.2-0.20250804083101-9cf424ecc926
251251

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHT
351351
github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw=
352352
github.com/jfrog/archiver/v3 v3.6.1 h1:LOxnkw9pOn45DzCbZNFV6K0+6dCsQ0L8mR3ZcujO5eI=
353353
github.com/jfrog/archiver/v3 v3.6.1/go.mod h1:VgR+3WZS4N+i9FaDwLZbq+jeU4B4zctXL+gL4EMzfLw=
354-
github.com/jfrog/build-info-go v1.8.9-0.20250923185138-4c44f2898e2d h1:hWrBCUDwFpcEJP1ReuhWJ23M/zWF2/jD5ATqSdw0G14=
355-
github.com/jfrog/build-info-go v1.8.9-0.20250923185138-4c44f2898e2d/go.mod h1:szdz9+WzB7+7PGnILLUgyY+OF5qD5geBT7UGNIxibyw=
354+
github.com/jfrog/build-info-go v1.8.9-0.20250924104816-8f9261b993f4 h1:UJ8QflsHBEdZLq5dfoFzzf6kgc+IxSe6dtZxVN/TDXY=
355+
github.com/jfrog/build-info-go v1.8.9-0.20250924104816-8f9261b993f4/go.mod h1:szdz9+WzB7+7PGnILLUgyY+OF5qD5geBT7UGNIxibyw=
356356
github.com/jfrog/froggit-go v1.20.3 h1:U3HHT0+AEHUVSSyQBbagQR4fLRqGqzSptPujDZuuDTk=
357357
github.com/jfrog/froggit-go v1.20.3/go.mod h1:obSG1SlsWjktkuqmKtpq7MNTTL63e0ot+ucTnlOMV88=
358358
github.com/jfrog/go-mockhttp v0.3.1 h1:/wac8v4GMZx62viZmv4wazB5GNKs+GxawuS1u3maJH8=

main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/agnivade/levenshtein"
14+
"github.com/jfrog/build-info-go/flexpack"
1415
gofrogcmd "github.com/jfrog/gofrog/io"
1516
artifactoryCLI "github.com/jfrog/jfrog-cli-artifactory/cli"
1617
"github.com/jfrog/jfrog-cli-core/v2/common/build"
@@ -133,7 +134,7 @@ func execMain() error {
133134
if err = setUberTraceIdToken(); err != nil {
134135
clientlog.Warn("failed generating a trace ID token:", err.Error())
135136
}
136-
if os.Getenv("JFROG_RUN_NATIVE") == "true" {
137+
if flexpack.IsFlexPackEnabled() {
137138
// If the JFROG_RUN_NATIVE environment variable is set to true, we run the new implementation
138139
// but only for package manager commands, not for JFrog CLI commands
139140
args := ctx.Args()
@@ -155,7 +156,7 @@ func execMain() error {
155156

156157
app.CommandNotFound = func(c *cli.Context, command string) {
157158
// Try to handle as native package manager command only when JFROG_RUN_NATIVE is true
158-
if os.Getenv("JFROG_RUN_NATIVE") == "true" && isPackageManagerCommand(command) {
159+
if flexpack.IsFlexPackEnabled() && isPackageManagerCommand(command) {
159160
clientlog.Debug("Attempting to handle as native package manager command:", command)
160161
err := runNativeImplementation(c)
161162
if err != nil {
@@ -194,7 +195,7 @@ func execMain() error {
194195
if err == nil {
195196
displaySurveyLinkIfNeeded()
196197
// Exit normally if native implementation ran successfully
197-
if os.Getenv("JFROG_RUN_NATIVE") == "true" && len(args) > 1 && isPackageManagerCommand(args[1]) {
198+
if flexpack.IsFlexPackEnabled() && len(args) > 1 && isPackageManagerCommand(args[1]) {
198199
// Only exit if we're not in a test environment
199200
if !isTestEnvironment() {
200201
os.Exit(0)

utils/buildinfo/buildinfo.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,16 +1019,13 @@ func setMavenBuildProperties(buildInfo *buildinfo.BuildInfo, buildConfiguration
10191019
return nil
10201020
}
10211021

1022-
// Get the deployment repository from the module
1023-
targetRepo := module.Repository
1022+
// Get the deployment repository from the first artifact
1023+
var targetRepo string
1024+
if len(module.Artifacts) > 0 {
1025+
targetRepo = module.Artifacts[0].OriginalDeploymentRepo
1026+
}
10241027
if targetRepo == "" {
1025-
log.Warn("No repository specified in module, trying to get from artifact deployment repo")
1026-
if len(module.Artifacts) > 0 {
1027-
targetRepo = module.Artifacts[0].OriginalDeploymentRepo
1028-
}
1029-
if targetRepo == "" {
1030-
return fmt.Errorf("no target repository found for setting properties")
1031-
}
1028+
return fmt.Errorf("no target repository found for setting properties")
10321029
}
10331030

10341031
// Set properties on each specific artifact by name and path

0 commit comments

Comments
 (0)