Skip to content

Maven issue #9

@nishaatr

Description

@nishaatr

When running a Maven step under RunAs, the step fails if a system property or environment variable has multi-line entry. Note: Maven passes system.* properties automatically to Maven.

Our failed build had three Nuget feeds defined in the system property and we got the following error:

[14:56:08][Step 1/1] Usage: java [-options] class [args...]
[14:56:08][Step 1/1] (to execute a class)
[14:56:08][Step 1/1] or java [-options] -jar jarfile [args...]
[14:56:08][Step 1/1] (to execute a jar file)
[14:56:08][Step 1/1] where options include:
[14:56:08][Step 1/1] -d32 use a 32-bit data model if available
[14:56:08][Step 1/1] -d64 use a 64-bit data model if available
[14:56:08][Step 1/1] -server to select the "server" VM
[14:56:08][Step 1/1] The default VM is server.
[14:56:08][Step 1/1]
[14:56:08][Step 1/1] -cp <class search path of directories and zip/jar files>
[14:56:08][Step 1/1] -classpath <class search path of directories and zip/jar files>
[14:56:08][Step 1/1] A ; separated list of directories, JAR archives,
[14:56:08][Step 1/1] and ZIP archives to search for class files.
...
...
...
[14:56:08][Step 1/1] 'http:' is not recognized as an internal or external command,
[14:56:08][Step 1/1] operable program or batch file.
[14:56:08][Step 1/1] 'http:' is not recognized as an internal or external command,
[14:56:08][Step 1/1] operable program or batch file.
[14:56:08][Step 1/1] 'http:' is not recognized as an internal or external command,
[14:56:08][Step 1/1] operable program or batch file.

Due to newlines in the property, Windows assumed it is a command and tried to run HTTP command (the Nuget feed start with http://feedurl). We resolved this by clearing the property in the build. We don't see this error when running without RunAs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions