0

Here is a simple command:

echo -DarchetypeGroupId=org.apache.maven.archetypes

When running in the Command Prompt, the output will be:

-DarchetypeGroupId=org.apache.maven.archetypes

enter image description here

When running in the PowerShell, the output will be:

-DarchetypeGroupId=org
.apache.maven.archetypes

enter image description here

When running in the PowerShell with echo.exe command:

echo.exe -DarchetypeGroupId=org.apache.maven.archetypes

The output will be:

-DarchetypeGroupId=org .apache.maven.archetypes

enter image description here

The tiny different will cause me unable to run many commands when using Apache Maven CLI in the PowerShell environment. Such as:

mvn archetype:generate -DgroupId=com.baeldung -DartifactId=parent-project -B

I can't find out what's the main reason cause for this issue in PowerShell. Does anyone know what's the language feature on PowerShell cause this issue?

Will Huang
  • 2,955
  • 2
  • 37
  • 90
  • "The tiny different will cause me unable to run many commands when using Apache Maven CLI in the PowerShell environment." - please show us some sample commands that are impacted by this. – Mathias R. Jessen Sep 09 '22 at 13:13
  • Here is the example: `mvn archetype:generate -DgroupId=com.baeldung -DartifactId=parent-project -B` – Will Huang Sep 09 '22 at 13:14
  • 2
    You're seeing a bug, unfortunately. _Quote_ your arguments to work around it, e.g.: `'-DarchetypeGroupId=org.apache.maven.archetypes'` The linked duplicate shows other workarounds and links to the relevant bug reports on GitHub. – mklement0 Sep 09 '22 at 13:16

0 Answers0