You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When executing a Dotnet build goal the build-info layer seems to inject an additional commandline argument to the dotnet command, namely --configfile. This gets injected at the end of the commandline arguments, after all of the user-provided arguments. This parameter is valid for certain dotnet sub-commands, such as dotnet restore and dotnet build but is not valid for goals such as dotnet test. As a result the underlying MSBuild command will complain about an invalid parameter.
The relevant lines of code are likely the ones below.
To Reproduce
In order to reproduce it from the Jfrog-CLI tools see jfrog/jfrog-cli#1799
In order to reproduce it from the Jenkins Artifactory plugin perform the following steps:
Set up the basic Artifactory build integration by adding the following to the scripted pipeline:
def rtBuild = Artifactory.newDotnetBuild()
rtBuild.resolver repo: 'nuget-remote', server: server //Replace with a correct Artifactory config
def buildInfo = rtBuild.run args: 'restore' //This will work as --configfile is valid for restore
rtBuild.run buildInfo: buildInfo, args: 'build' //This will work as --configfile is valid for build
rtBuild.run buildInfo: buildInfo, args: 'test' //This will fail as --configfile is not valid for test
Run the Jenkins job. The pipeline will fail with an error message similar to
Expected behavior
The --configfile parameter should only be injected for dotnet goals that support it. Alternatively the run-command API should provide a parameter to turn off automatic argument injection for that particular goal, e.g
Obviously the second solution would also require modifications to higher level tools such as the Jenkins plugin and Jfrog CLI and might because of this not be the ideal solution.
Versions
Extractor version: Seems to affect the most recent version given the source code references provided.
Operating system: Seems to affect both Windows and Linux.
Artifactory Version: 7.49.3
Additional context
A workaround is to pass a shell comment symbol at the end of the provided command. Example:
rtBuild.run buildInfo: buildInfo, args: 'test &REM' //For Windows
rtBuild.run buildInfo: buildInfo, args: 'test #' //For Linux
This comments out the injected argument when passed to the shell.
The text was updated successfully, but these errors were encountered:
Describe the bug
When executing a Dotnet build goal the build-info layer seems to inject an additional commandline argument to the
dotnet
command, namely--configfile
. This gets injected at the end of the commandline arguments, after all of the user-provided arguments. This parameter is valid for certaindotnet
sub-commands, such asdotnet restore
anddotnet build
but is not valid for goals such asdotnet test
. As a result the underlying MSBuild command will complain about an invalid parameter.The relevant lines of code are likely the ones below.
The argument is declared here:
build-info/build-info-extractor-nuget/src/main/java/org/jfrog/build/extractor/nuget/drivers/ToolchainDriverBase.java
Line 22 in 67cefb2
And gets injected here:
build-info/build-info-extractor-nuget/src/main/java/org/jfrog/build/extractor/nuget/extractor/NugetRun.java
Lines 190 to 200 in 642ee6a
To Reproduce
In order to reproduce it from the Jfrog-CLI tools see jfrog/jfrog-cli#1799
In order to reproduce it from the Jenkins Artifactory plugin perform the following steps:
Expected behavior
The
--configfile
parameter should only be injected fordotnet
goals that support it. Alternatively therun
-command API should provide a parameter to turn off automatic argument injection for that particular goal, e.gObviously the second solution would also require modifications to higher level tools such as the Jenkins plugin and Jfrog CLI and might because of this not be the ideal solution.
Versions
Additional context
A workaround is to pass a shell comment symbol at the end of the provided command. Example:
This comments out the injected argument when passed to the shell.
The text was updated successfully, but these errors were encountered: