[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17841618#comment-17841618
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1582075348


##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }

Review Comment:
   You are totally right. My bad!





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17841617#comment-17841617
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1582075212


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "Maven command ($MAVEN_HOME\bin\mvn.ps1) cannot be 
found" -ErrorAction Stop
+}

Review Comment:
   But how can this happen at all? This is a chicken-and-egg issue. This block 
is part of the merged `mvn.ps1`. If the file is not present that check will 
never happen, no? This confuses me.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17841616#comment-17841616
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1582075040


##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+  $root_path_base_name = ((get-item $path).Root.BaseName
+  $path_base_name = ((get-item $path).BaseName
+
+  return $root_path_base_name -ne $path_base_name
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_config = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_config) {
+return $env:MAVEN_OPTS + " " + -Join (Get-Content $jvm_config)
+  }
+  return $env:MAVEN_OPTS

Review Comment:
   You are joining the content of the `jvm.config` file with `MAVEN_OPTS` 
variable in one guy. From a caller's perspective that should not be done and it 
is not obvious from where the config comes. Look at the original files, they do 
not merge them.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837872#comment-17837872
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1567902958


##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }

Review Comment:
   Is `Test-File` a valid command in powershell? 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837868#comment-17837868
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1567900347


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "Maven command ($MAVEN_HOME\bin\mvn.ps1) cannot be 
found" -ErrorAction Stop
+}

Review Comment:
   If `mvn.ps1` or `mvn.cmd` is removed or not accessible.  
   
   But it is indeed a corner case, shall we remove it? 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837865#comment-17837865
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1567897655


##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+  $root_path_base_name = ((get-item $path).Root.BaseName
+  $path_base_name = ((get-item $path).BaseName
+
+  return $root_path_base_name -ne $path_base_name
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_config = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_config) {
+return $env:MAVEN_OPTS + " " + -Join (Get-Content $jvm_config)
+  }
+  return $env:MAVEN_OPTS

Review Comment:
   I don't understand your comment. 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2024-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837119#comment-17837119
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1565386307


##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+  $root_path_base_name = ((get-item $path).Root.BaseName
+  $path_base_name = ((get-item $path).BaseName
+
+  return $root_path_base_name -ne $path_base_name
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_config = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_config) {
+return $env:MAVEN_OPTS + " " + -Join (Get-Content $jvm_config)
+  }
+  return $env:MAVEN_OPTS
+}
+
+$basedir = ""
+
+if ($file_flag_found) {
+  # we need to assess if the file exists
+  # and then search for the maven project base dir. 
+  $pom_file_reference = $args[$i + 1]
+
+  if (Test-Path $pom_file_reference) {
+$basedir = (Get-Item $pom_file_reference).DirectoryName
+  }
+  else {
+$pom_file_error = "POM file " + $pom_file_reference + " specified the 
-f/--file command-line argument does not exist"
+Write-Error -Message $pom_file_error -ErrorAction Stop
+  }
+}
+else {
+  # if file flag is not found, then the pom.xml is relative to the working dir 
+  # and the jvm.config can be found in the maven project base dir. 
+
+  $basedir = $WDIR
+
+  while (IsNotRoot($WDIR.Path)) {
+if (Test-Path "$WDIR\.mvn") {
+  $basedir = $WDIR
+  break
+}
+
+if ($WDIR) {
+  $WDIR = Split-Path $WDIR  
+}
+else {
+  break
+}  
+  }
+}
+
+$MAVEN_OPTS = (RetrieveContentsJvmConfig $basedir)

Review Comment:
   See above.



##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+  $root_path_base_name = ((get-item $path).Root.BaseName
+  $path_base_name = ((get-item $path).BaseName
+
+  return $root_path_base_name -ne $path_base_name
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_config = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_config) {
+return $env:MAVEN_OPTS + " " + -Join (Get-Content $jvm_config)
+  }
+  return $env:MAVEN_OPTS

Review Comment:
   That is not correct. If the file is empty then it is empty. See approach in 
`init`.



##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"

Review Comment:
   I'd keep it identical to `init.cmd`.



##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,43 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775309#comment-17775309
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1763182870

   > It would be nice to fix the command terminal title, the rest LGTM
   
   I've created an issue to improve the command terminal title: 
https://issues.apache.org/jira/browse/MNG-7907
   
   The description is a little bit rough right now and needs some extra 
refinement. 
   




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774875#comment-17774875
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1358102359


##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }

Review Comment:
   You are right, I've misread it





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774865#comment-17774865
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1358087993


##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }

Review Comment:
   No, look at the other files. First we load general, then specific. This give 
the user the option to override everything.



##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }

Review Comment:
   No, look at the other implementations. First we load general, then specific. 
This give the user the option to override everything.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774864#comment-17774864
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1358084618


##
apache-maven/src/assembly/shared/validate.ps1:
##
@@ -0,0 +1,53 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }

Review Comment:
   I was wondering if it would make more sense to prioritize looking in the 
userprofile first before going to a more generic location





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774861#comment-17774861
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1358075540


##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"

Review Comment:
   Should this be part of `mvnlauncher.ps1` as it is never used in this file?





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-10-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774854#comment-17774854
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1358059984


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,43 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+#>
+
+<#-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand

Review Comment:
   This probably has the same 'issue' as as 3.x script: 
https://github.com/apache/maven/pull/982#discussion_r1324860640?





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768171#comment-17768171
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334839636


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand
+
+if (-not $env:MAVEN_DEBUG_ADDRESS ) {
+  $env:MAVEN_DEBUG_ADDRESS = "8000"

Review Comment:
   I've changed the description.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768168#comment-17768168
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334834141


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop

Review Comment:
   Should be identical to others



##
apache-maven/src/assembly/shared/run.ps1:
##
@@ -0,0 +1,13 @@
+& $JAVACMD `
+  $MAVEN_OPTS `
+  $MAVEN_DEBUG_OPTS `
+  -classpath $LAUNCHER_JAR `

Review Comment:
   I would expect, at least the same behavior as the others...





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768167#comment-17768167
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334833714


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand
+
+if (-not $env:MAVEN_DEBUG_ADDRESS ) {
+  $env:MAVEN_DEBUG_ADDRESS = "8000"

Review Comment:
   This I know, but still, line 27 does not correspond to line 35





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768163#comment-17768163
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334826314


##
apache-maven/src/assembly/shared/run.ps1:
##
@@ -0,0 +1,13 @@
+& $JAVACMD `
+  $MAVEN_OPTS `
+  $MAVEN_DEBUG_OPTS `
+  -classpath $LAUNCHER_JAR `

Review Comment:
   To my knowledge, yes. You don't expect spaces to be handled? 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768162#comment-17768162
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334825689


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop

Review Comment:
   No, we don't have such a message with the other scripts. From my point of 
view if the maven command can't be found, the script must stop and print an 
error so the problem can be resolved. 
   
   Although this would be an edge case. 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768160#comment-17768160
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334818771


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand
+
+if (-not $env:MAVEN_DEBUG_ADDRESS ) {
+  $env:MAVEN_DEBUG_ADDRESS = "8000"

Review Comment:
   But it correspond to the use in the debug string. 
   
   And with Java > 9, it is possible to specify ip and port, e.g. 8.8.8.8:8000
   Or if you want to bind to all network interfaces (which would be the same 
behavior as in java <9): *:8000
   To specify only port, will result with java > 9: 127.0.0.1:8000
   
   Luckily it is possible to override the environment variable.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768159#comment-17768159
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1334818771


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand
+
+if (-not $env:MAVEN_DEBUG_ADDRESS ) {
+  $env:MAVEN_DEBUG_ADDRESS = "8000"

Review Comment:
   But it correspond to the use in the debug string. 
   
   And with Java > 9, it is possible to specify ip and port, e.g. 8.8.8.8:8000
   Or if you want to bind to all network interfaces: *:8000





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767721#comment-17767721
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1333573181


##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>

Review Comment:
   Maybe license hedader and description should be separate comment blocks...



##
apache-maven/src/assembly/shared/init.ps1:
##
@@ -0,0 +1,83 @@
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+  $root_path_base_name = ((get-item $path).Root.BaseName
+  $path_base_name = ((get-item $path).BaseName
+
+  return $root_path_base_name -ne $path_base_name
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_location = $path + "\.mvn\jvm.config"

Review Comment:
   The name of this var is weird, this is not about the JVM location, but 
rather `$jvm_config`?



##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop

Review Comment:
   Why not `($MAVEN_HOME \bin\mvn.ps1)`?
   Do we have such a message with the other scripts?



##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,7 @@
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot).Parent
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop

Review Comment:
   Maven...



##
apache-maven/src/assembly/shared/run.ps1:
##
@@ -0,0 +1,13 @@
+& $JAVACMD `
+  $MAVEN_OPTS `
+  $MAVEN_DEBUG_OPTS `
+  -classpath $LAUNCHER_JAR `

Review Comment:
   Will this handle spaces in `$LAUNCHER_JAR`?



##
apache-maven/src/assembly/maven/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767712#comment-17767712
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1730247235

   @Giovds @michael-o This branch contains the latest improvements from #982.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767671#comment-17767671
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1730072787

   > > > As a matter of fact, this implemenation should copy the approach from 
mvn.cmd from master, not from maven-3.9.x. It does not matter to add something 
new and then skim a bit later. Then it would be back ported to 3.9.x as-is 
logically.
   > > 
   > > 
   > > Wouldn't it not be better to get 
[master](https://github.com/apache/maven/pull/878) reviewed first and then 
retrofit the approach in master to the 3.9.x branch? Please be aware that there 
will be two different approaches in the component.xml, which makes reviewing a 
little bit harder.
   > 
   > True, but the content of the script won't change, only its arrangement.
   
   Ok, in that case we are aligned. I'll update the master branch with the 
improvements on this branch. When the master is merged, I'll retrofit the 
changes into this branch.
   
   @Giovds Are you available for reviewing the master PR? I first need to apply 
the changes on this branch to the master (#878).




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767411#comment-17767411
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1728951967

   > > As a matter of fact, this implemenation should copy the approach from 
mvn.cmd from master, not from maven-3.9.x. It does not matter to add something 
new and then skim a bit later. Then it would be back ported to 3.9.x as-is 
logically.
   > 
   > Wouldn't it not be better to get 
[master](https://github.com/apache/maven/pull/878) reviewed first and then 
retrofit the approach in master to the 3.9.x branch? Please be aware that there 
will be two different approaches in the component.xml, which makes reviewing a 
little bit harder.
   
   True, but the content of the script won't change, only its arrangement.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767296#comment-17767296
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1728462781

   > As a matter of fact, this implemenation should copy the approach from 
mvn.cmd from master, not from maven-3.9.x. It does not matter to add something 
new and then skim a bit later. Then it would be back ported to 3.9.x as-is 
logically.
   
   Wouldn't it not be better to get 
[master](https://github.com/apache/maven/pull/878) reviewed first and then 
retrofit the approach in master to the 3.9.x branch? Please be aware that there 
will be two different approaches in the component.xml, which makes reviewing a 
little bit harder. 




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767291#comment-17767291
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1332195898


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {

Review Comment:
   The nice thing about the choice I made is that the command line parameters 
are consistent through all shells. With using named parameters, the parameters 
will have only one `-`. 
   
   It would also require changing `CLIManager`, the changes would become bigger 
than I anticipated.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767285#comment-17767285
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1332158623


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.

Review Comment:
   The `JAVA_HOME` variable is set as optional, in a similar way as the cmd 
implmentation. the cmd implementation also resolves the java exe on path. 
   I consider this out of scope of this PR.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767280#comment-17767280
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1332140137


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }

Review Comment:
   I wouldn't do it. New script, new behavior.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767272#comment-17767272
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1332118562


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."

Review Comment:
   - Just dived into this topic. The difference between with `throw` and 
`write-error` is that `write-error` writes to the error stream and `throw` 
doesn't.

   - Since PowerShell 7.2 the default `$errorView` is set to ConciseView. Your 
example would show something like this:
   
   
![image](https://github.com/apache/maven/assets/12400620/f3a0488f-2829-468d-b3dc-5bc4451e776a)
   
   Based on the above I think I don't need to change the implementation.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-20 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17767244#comment-17767244
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1332066994


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName

Review Comment:
   @Giovds It is only part of mvnDebug, it shouldn't be part of mvn.ps1 IMHO. I 
like your idea, but it shouldn't be part of this PR, but in a separate issue. 
   For now I'll remove this from mvn.ps1.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17765047#comment-17765047
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1718967878

   As a matter of fact, this implemenation should copy the approach from 
`mvn.cmd` from `master`, not from `maven-3.9.x`. It does not matter to add 
something new and then skim a bit later.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17765038#comment-17765038
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325500076


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+
+  return -not $path.endsWith(":\")

Review Comment:
   Me neither, but you never know what you find in the wild 



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764916#comment-17764916
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325164293


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 

Review Comment:
   I agree! We need to do a try-catch here.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764915#comment-17764915
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325162239


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."

Review Comment:
   Just tried to find an answer from the powershell community which would might 
give a best practice. 
   
   I don't have a strong opinion on this one. 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764914#comment-17764914
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325161599


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+
+  return -not $path.endsWith(":\")
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_location = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_location) {
+return $env:MAVEN_OPTS + (Get-Content $jvm_location).Replace("`n", 
"").Replace("`r", "");
+  }
+  return $env:MAVEN_OPTS;
+}
+
+$basedir = ""
+
+if ($file_flag_found) {
+  # we need to assess if the file exists
+  # and then search for the maven project base dir. 
+  $pom_file_reference = $args[$i + 1]
+
+  if (Test-Path $pom_file_reference) {
+$basedir = (Get-Item $pom_file_reference).DirectoryName
+  }
+  else {
+$pom_file_error = "POM file " + $pom_file_reference + " specified the 
-f/--file command-line argument does not exist"
+Write-Error -Message $pom_file_error -ErrorAction Stop
+  }
+}
+else {
+  # if file flag is not found, then the pom.xml is relative to the working dir 
+  # and the jvm.config can be found in the maven project base dir. 
+
+  $basedir = $WDIR
+
+  while (IsNotRoot($WDIR.Path)) {
+if (Test-Path "$WDIR\.mvn") {
+  $basedir = $WDIR
+  break
+}
+
+if ($WDIR) {
+  $WDIR = Split-Path $WDIR  
+}
+else {
+  break
+}  
+  }
+}
+
+$MAVEN_OPTS = (RetrieveContentsJvmConfig $basedir)
+
+$LAUNCHER_JAR = Get-Item $MAVEN_HOME"\boot\plexus-classworlds*.jar"

Review Comment:
   No there is only 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764910#comment-17764910
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325153454


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+
+  return -not $path.endsWith(":\")

Review Comment:
   I wouldn't recommend using maven on a share, it would be not the fastest 
experience. 



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764909#comment-17764909
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325152454


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+
+  return -not $path.endsWith(":\")
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_location = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_location) {
+return $env:MAVEN_OPTS + (Get-Content $jvm_location).Replace("`n", 
"").Replace("`r", "");
+  }
+  return $env:MAVEN_OPTS;
+}
+
+$basedir = ""
+
+if ($file_flag_found) {
+  # we need to assess if the file exists
+  # and then search for the maven project base dir. 
+  $pom_file_reference = $args[$i + 1]
+
+  if (Test-Path $pom_file_reference) {
+$basedir = (Get-Item $pom_file_reference).DirectoryName
+  }
+  else {
+$pom_file_error = "POM file " + $pom_file_reference + " specified the 
-f/--file command-line argument does not exist"
+Write-Error -Message $pom_file_error -ErrorAction Stop
+  }
+}
+else {
+  # if file flag is not found, then the pom.xml is relative to the working dir 
+  # and the jvm.config can be found in the maven project base dir. 
+
+  $basedir = $WDIR
+
+  while (IsNotRoot($WDIR.Path)) {
+if (Test-Path "$WDIR\.mvn") {
+  $basedir = $WDIR
+  break
+}
+
+if ($WDIR) {
+  $WDIR = Split-Path $WDIR  
+}
+else {
+  break
+}  
+  }
+}
+
+$MAVEN_OPTS = (RetrieveContentsJvmConfig $basedir)
+
+$LAUNCHER_JAR = Get-Item $MAVEN_HOME"\boot\plexus-classworlds*.jar"

Review Comment:
   No, there is one 

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764908#comment-17764908
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325148568


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 
+  if (-not $JAVACMD) {
+Write-Error -ErrorAction Stop -Message "The $env:JAVA_HOME has not been 
set, JAVA_HOME environment variable is not defined correctly, so Apache Maven 
cannot be started."
+  }
+}
+else {
+  $JAVACMD = $env:JAVA_HOME + "\bin\java.exe"
+}
+
+if (-not (Test-Path $JAVACMD)) {
+  Write-Error -Message "The JAVA_HOME environment variable is not defined 
correctly, so Apache Maven cannot be started."
+  $ERROR_MESSAGE = "JAVA_HOME is set to " + $env:JAVA_HOME + ", but " + 
$JAVACMD + " does not exist."
+  Write-Error -ErrorAction Stop -Message $ERROR_MESSAGE
+}
+
+# check mvn home
+$MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+
+# check if maven command exists
+if (-not (Test-path "$MAVEN_HOME\bin\mvn.ps1")) {
+Write-Error -Message "maven command (\bin\mvn.ps1) cannot be found" 
-ErrorAction Stop
+}
+#  END VALIDATION 
+
+$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf"
+
+# Find the project basedir, i.e., the directory that contains the directory 
".mvn".
+# Fallback to current working directory if not found.
+
+$WDIR = Get-Location
+
+# Look for the --file switch and start the search for the .mvn directory from 
the specified
+# POM location, if supplied.
+
+$i = 0
+$file_flag_found = $false
+foreach ($arg in $args) {
+  if (($arg -ceq "-f") -or ($arg -ceq "--file")) {
+$file_flag_found = $true
+break
+  }
+  $i += 1
+}
+
+function IsNotRoot {
+  param (
+[String] $path
+  )
+
+  return -not $path.endsWith(":\")
+}
+
+function RetrieveContentsJvmConfig {
+  param (
+[String] $path
+  )
+
+  $jvm_location = $path + "\.mvn\jvm.config"
+
+  if (Test-Path $jvm_location) {
+return $env:MAVEN_OPTS + (Get-Content $jvm_location).Replace("`n", 
"").Replace("`r", "");
+  }
+  return $env:MAVEN_OPTS;
+}
+
+$basedir = ""
+
+if ($file_flag_found) {
+  # we need to assess if the file exists
+  # and then search for the maven project base dir. 
+  $pom_file_reference = $args[$i + 1]
+
+  if (Test-Path $pom_file_reference) {
+$basedir = (Get-Item $pom_file_reference).DirectoryName
+  }
+  else {
+$pom_file_error = "POM file " + $pom_file_reference + " specified the 
-f/--file command-line argument does not exist"
+Write-Error -Message $pom_file_error -ErrorAction Stop
+  }
+}
+else {
+  # if file flag is not found, then the pom.xml is relative to the working dir 
+  # and the jvm.config can be found in the maven project base dir. 
+
+  $basedir = $WDIR
+
+  while (IsNotRoot($WDIR.Path)) {

Review Comment:
   Nope, it would use the current working directory as basedir.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764906#comment-17764906
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1325147437


##
apache-maven/src/bin/mvnDebug.ps1:
##
@@ -0,0 +1,42 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Debug Script
+
+Environment Variable Prerequisites
+
+JAVA_HOME   (Optional) Points to a Java installation.
+MAVEN_OPTS  (Optional) Java runtime options used when Maven is 
executed.
+MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is 
localhost:8000
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand
+
+if (-not $env:MAVEN_DEBUG_ADDRESS ) {
+$env:MAVEN_DEBUG_ADDRESS = "localhost:8000"
+}
+
+$env:MAVEN_DEBUG_OPTS = "-Xdebug 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$env:MAVEN_DEBUG_ADDRESS"

Review Comment:
   Yes, you are right. I made here the assumption that people would use java > 
9. However earlier versions of java seems not to support this notation. 
   
   Please bear in mind that the behavior changes with java > 9, it will bind to 
only localhost instead of all internet interfaces. 
   
   I'll change it, to bring it line with the .cmd file. 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17764872#comment-17764872
 ] 

ASF GitHub Bot commented on MNG-7541:
-

Giovds commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1324860640


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName

Review Comment:
   It would be nice to reset the title, otherwise your shell will keep showing 
`some-path\mvn.p1` long after maven is done unless you open a new window. It 
could also act as a visual indication maven is done if you have multiple tabs 
open. 



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-
+Apache Maven Startup Script
+
+Environment Variable Prerequisites
+
+  JAVA_HOME   (Optional) Points to a Java installation.
+  MAVEN_ARGS  (Optional) Arguments passed to Maven before CLI arguments.
+  MAVEN_OPTS  (Optional) Java runtime options used when Maven is executed.
+  MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
+-
+#>
+
+# set title
+$Host.UI.RawUI.WindowTitle = (Get-Variable MyInvocation -Scope 
Script).Value.InvocationName
+
+if (-not $env:MAVEN_SKIP_RC) {
+  if (Test-Path -Path $env:PROGRAMDATA\mavenrc.ps1 -PathType Leaf) { 
&$env:PROGRAMDATA"\mavenrc.ps1" $args }
+  if (Test-Path -Path $env:USERPROFILE\mavenrc.ps1 -PathType Leaf) { 
&$env:USERPROFILE"\mavenrc.ps1" $args }
+}
+
+if (-not (Test-path $env:JAVA_HOME)) {
+  $JAVACMD = (get-command java).Source 

Review Comment:
   I'm pretty sure `Get-Command` throws an exception if a command is not found. 
This would hard exit here and not show the clearer error on line 42



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+

[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-11 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17763858#comment-17763858
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1714361609

   @michael-o I understand your reserves, certainly if your see your PS 
knowledge as humble (I don't see myself as an expert either). 
   At the same time @slachiewicz has given an approval. What's needed in order 
to get this PR merged?
   
   Please let me know what is needed, then I can specifically ask for 
input/help on the mailing list. 




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17763420#comment-17763420
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1712797058

   For the time being, I want work on this since I don't have the capacity nor 
decent PowerShell scripting skill set. My knowledge in PS humble.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-08-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17749998#comment-17749998
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1660960598

   > > > Not now, ATM. I need to consult also a colleague who's proficient in 
PowerShell.
   > > 
   > > 
   > > Is there some progress?
   > 
   > I hope to pick this up when my round with reporting stack is complete for 
next milestone. I guess somewere end of month. Please also raise your voice on 
dev@ to drag more attraction to this topic.
   
   Is there some progress? 




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-06-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17729940#comment-17729940
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1579987124

   > > Not now, ATM. I need to consult also a colleague who's proficient in 
PowerShell.
   > 
   > Is there some progress?
   
   I hope to pick this up when my round with reporting stack is complete for 
next milestone. I guess somewere end of month. Please also raise your voice on 
dev@ to drag more attraction to this topic.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-06-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17729841#comment-17729841
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1579424801

   > Not now, ATM. I need to consult also a colleague who's proficient in 
PowerShell.
   
   Is there some progress?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17718889#comment-17718889
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1532797801

   Not now, ATM. I need to consult also a colleague who's proficient in 
PowerShell.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712632#comment-17712632
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1509736721

   @michael-o Can I do something to make this pull request merged? 




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712631#comment-17712631
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1509736437

   @michael-o Gentle reminder




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-03-17 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17701984#comment-17701984
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1474362717

   > @michael-o From my perspective this PR is ready. What's your perspective 
on this position?
   
   I want to get back to this end of month.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-03-17 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17701979#comment-17701979
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1474352343

   @michael-o From my perspective this PR is ready. What's your perspective on 
this position?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-03-17 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17701977#comment-17701977
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1474351004

   @michael-o @slachiewicz What do we need to do to merge this merge request?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685608#comment-17685608
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner closed pull request #877: [MNG-7541] Implement powershell mvn 
command
URL: https://github.com/apache/maven/pull/877




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685607#comment-17685607
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #877:
URL: https://github.com/apache/maven/pull/877#issuecomment-1421590973

   @michael-o In that case I will close this PR.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685482#comment-17685482
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421484979

   > @michael-o Should we remove `.cmd` in #877?
   
   No, since the PR is only about addtion of a PS-based solution. No more, no 
less.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685483#comment-17685483
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #877:
URL: https://github.com/apache/maven/pull/877#issuecomment-1421485902

   > The CoreIT failed on branch `3.8.x`, couldn't find the reason why (it 
seems unrelated). It passed for `master` and `3.9.x.`
   > 
   > Is it an idea to skip `3.8.x`?
   
   This change will very unlikely land in 3.8.x.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685481#comment-17685481
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #877:
URL: https://github.com/apache/maven/pull/877#issuecomment-1421484485

   The CoreIT failed on branch `3.8.x`, couldn't find the reason why (it seems 
unrelated). 
   It passed for `master` and `3.9.x.`
   
   Is it an idea to skip `3.8.x`?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685480#comment-17685480
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1421482049

   The CoreIT tests have run well. #982 mentions to remove `.cmd` in master. 
Please let me know whether I need to continue.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685479#comment-17685479
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421478703

   @michael-o Should we remove `.cmd` in 
https://github.com/apache/maven/pull/877?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685473#comment-17685473
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421460834

   > > > I wonder if it would make sense to remove the `.cmd` script instead of 
keeping both `.ps1` and `.cmd` scripts.
   > > 
   > > 
   > > That will likely break things so maybe that should be targeted for v4
   > 
   > Yes, I had not seen this PR was targeting 3.9.x specifically.
   
   I'd require this to be on master first and then backported...at most




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685471#comment-17685471
 ] 

ASF GitHub Bot commented on MNG-7541:
-

gnodet commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421459223

   > > I wonder if it would make sense to remove the `.cmd` script instead of 
keeping both `.ps1` and `.cmd` scripts.
   > 
   > That will likely break things so maybe that should be targeted for v4
   
   Yes, I had not seen this PR was targeting 3.9.x specifically.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685449#comment-17685449
 ] 

ASF GitHub Bot commented on MNG-7541:
-

yeikel commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421331792

   > I wonder if it would make sense to remove the `.cmd` script instead of 
keeping both `.ps1` and `.cmd` scripts.
   
   That will likely break things so maybe that should be targeted for v4




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685441#comment-17685441
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1099091278


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   Don't waste your time. This won't happen.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685438#comment-17685438
 ] 

Michael Osipov commented on MNG-7541:
-

This needs to be fully tested at least with all of our components and properly 
announced.

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread Guillaume Nodet (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685431#comment-17685431
 ] 

Guillaume Nodet commented on MNG-7541:
--

I wonder if it would make sense to remove the `.cmd` script instead of keeping 
both `.ps1` and `.cmd` scripts.

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685432#comment-17685432
 ] 

ASF GitHub Bot commented on MNG-7541:
-

gnodet commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1421297178

   I wonder if it would make sense to remove the `.cmd` script instead of 
keeping both `.ps1` and `.cmd` scripts.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685419#comment-17685419
 ] 

ASF GitHub Bot commented on MNG-7541:
-

yeikel commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1099048520


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   That's fair. I don't see any issue with that



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   That's fair. I don't see any issue with that plan





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685415#comment-17685415
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1099043083


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   @yeikel Good point. But why would we do it only in this occurrence? At this 
moment in time the http link is used in 1,663 places (it redirects properly to 
https). What would you think about the idea to create a separate pull request 
to resolve this for the whole codebase? For instance for the `3.9.x` and 
`master` branch. 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17685355#comment-17685355
 ] 

ASF GitHub Bot commented on MNG-7541:
-

yeikel commented on code in PR #982:
URL: https://github.com/apache/maven/pull/982#discussion_r1098831110


##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   Can we make this `https`? 



##
apache-maven/src/bin/mvn.ps1:
##
@@ -0,0 +1,158 @@
+<#
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0

Review Comment:
   Can we set this to `https`? 





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684924#comment-17684924
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1419694222

   @slachiewicz  see here the pull request concerning the 3.9.x branch




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684923#comment-17684923
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1419692902

   After pulling the latest version of the core-its, it was running fine. So 
the core-its ran successfully.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684355#comment-17684355
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #982:
URL: https://github.com/apache/maven/pull/982#issuecomment-1418284036

   Core IT tests fails currently on
   
`MavenITmng6609ProfileActivationForPackagingTest.testitMojoExecution:42->AbstractMavenIntegrationTestCase.assertEquals:668->AbstractMavenIntegrationTestCase.assertEquals:673
 expected:  but was: `
   
   It doesn't seem to be related to the changes made in this pull request.




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684353#comment-17684353
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #877:
URL: https://github.com/apache/maven/pull/877#issuecomment-1418275449

   > please switch to 
[apache:maven-3.9.x](https://github.com/apache/maven/tree/maven-3.9.x) branch
   
   See pull request https://github.com/apache/maven/pull/982/commits for the 
merge on apache:maven-3.9.x branch




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684352#comment-17684352
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner opened a new pull request, #982:
URL: https://github.com/apache/maven/pull/982

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG) filed
  for the change (usually before you start working on it).  Trivial 
changes like typos do not
  require a JIRA issue. Your pull request should address just this 
issue, without
  pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line 
and body.
- [x] Format the pull request title like `[MNG-XXX] SUMMARY`,
  where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA 
issue.
- [x] Also format the first line of the commit message like `[MNG-XXX] 
SUMMARY`.
  Best practice is to use the JIRA issue title in both the pull request 
title and in the first line of the commit message.
- [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
- [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
- [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2023-02-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17684162#comment-17684162
 ] 

ASF GitHub Bot commented on MNG-7541:
-

slachiewicz commented on PR #877:
URL: https://github.com/apache/maven/pull/877#issuecomment-1416746739

   please switch to 
[apache:maven-3.9.x](https://github.com/apache/maven/tree/maven-3.9.x) branch




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636234#comment-17636234
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1320973205

   Try the Maven Core ITs with this. Make sure that `.cmd` isn't included, just 
in case.
   




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636233#comment-17636233
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1320973095

   This is at least what I have, although I work from Windows Terminal with 
PowerShell 7 only:
   ```
   C:\Users\mosipov> $PSVersionTable
   
   Name   Value
   --

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636232#comment-17636232
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1320972669

   > Has this been tested with Windows PowerShell or PowerShell 7?
   
   Mainly with powershell 7.3.0, but now also with powershell 5.1.22621.608. 
   
   The test is done by running `mvn clean package` on a simple project. It will 
not cover all use-cases for the scripts that have been changed. Is there an 
example project to check all of these? 




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636222#comment-17636222
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on PR #878:
URL: https://github.com/apache/maven/pull/878#issuecomment-1320959718

   Has this been tested with Windows PowerShell or PowerShell 7?




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636221#comment-17636221
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1027136370


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,9 @@
+# check mvn home
+if (-not $env:MAVEN_HOME) {
+$env:MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+}

Review Comment:
   These scripts are implementation details and can change from version to 
version therefore we cannot share those between other Maven homes reliably.





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636211#comment-17636211
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1027127586


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,9 @@
+# check mvn home
+if (-not $env:MAVEN_HOME) {
+$env:MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+}

Review Comment:
   Interesting... I assumed it had the similar interpretation as JAVA_HOME 
(which is an environment variable). Always dangerous, making assumptions... 樂 
   
   Thanks for pointing it out! I'll update the pull request. 
   





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636185#comment-17636185
 ] 

ASF GitHub Bot commented on MNG-7541:
-

michael-o commented on code in PR #878:
URL: https://github.com/apache/maven/pull/878#discussion_r1027108363


##
apache-maven/src/assembly/shared/mvnvalidate.ps1:
##
@@ -0,0 +1,9 @@
+# check mvn home
+if (-not $env:MAVEN_HOME) {
+$env:MAVEN_HOME = (Get-Item $PSScriptRoot"\..")
+}

Review Comment:
   This is wrong. `MAVEN_HOME` is neither an environment variable, nor can it 
be passed externally. It is solely private. See 
https://github.com/apache/maven/blob/29283a10596c92a9283d789d4c661dd242cec916/apache-maven/src/assembly/shared/mvnvalidate





> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636184#comment-17636184
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner opened a new pull request, #878:
URL: https://github.com/apache/maven/pull/878

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [X] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG) filed
  for the change (usually before you start working on it).  Trivial 
changes like typos do not
  require a JIRA issue. Your pull request should address just this 
issue, without
  pulling in other changes.
- [X] Each commit in the pull request should have a meaningful subject line 
and body.
- [X] Format the pull request title like `[MNG-XXX] SUMMARY`, where you 
replace `MNG-XXX`
  and `SUMMARY` with the appropriate JIRA issue. Best practice is to 
use the JIRA issue
  title in the pull request title and in the first line of the commit 
message.
- [X] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
- [X] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
- [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-11-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17636183#comment-17636183
 ] 

ASF GitHub Bot commented on MNG-7541:
-

JurrianFahner opened a new pull request, #877:
URL: https://github.com/apache/maven/pull/877

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [X] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG) filed
  for the change (usually before you start working on it).  Trivial 
changes like typos do not
  require a JIRA issue. Your pull request should address just this 
issue, without
  pulling in other changes.
- [X] Each commit in the pull request should have a meaningful subject line 
and body.
- [X] Format the pull request title like `[MNG-XXX] SUMMARY`, where you 
replace `MNG-XXX`
  and `SUMMARY` with the appropriate JIRA issue. Best practice is to 
use the JIRA issue
  title in the pull request title and in the first line of the commit 
message.
- [X] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [X] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
- [X] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
- [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-10-08 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17614406#comment-17614406
 ] 

Michael Osipov commented on MNG-7541:
-

[~jfahner], please note that in Maven 4 the start scripts have been broken up 
into single components. This is what you have to provide also. The scripts have 
been simplified in Maven 4 and aren't compatible with Maven 3.

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-10-07 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17614288#comment-17614288
 ] 

Michael Osipov commented on MNG-7541:
-

Core and Wrapper are two projects. So separate PRs. Willing to review mvn.ps1.

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-10-07 Thread Jurrian Fahner (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17614282#comment-17614282
 ] 

Jurrian Fahner commented on MNG-7541:
-

[~michael-o] Shall I create a PR based on the implementation for mvn.ps1?

We also need to take care of the mvnw.cmd. Do we want to have it in one PR or 
can we implement the functionality in several PRs?

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for PowerShell to start Maven

2022-10-04 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17612641#comment-17612641
 ] 

Michael Osipov commented on MNG-7541:
-

Those need to be reviewed:
{noformat}
$ grep -r --include='*.java' \\.cmd .
./plugins/tools/scm/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java:
String winMvnPath = mvnPath + ".cmd";
./shared/invoker/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java:
File executableFile = new File( baseDirectory, executable + ".cmd" 
);
{noformat}

I can take cake of Maven SCM, [~sjaranowski], do you want to address Invoker?

> Native support for PowerShell to start Maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for powershell to start maven

2022-10-04 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17612603#comment-17612603
 ] 

Michael Osipov commented on MNG-7541:
-

I'd be in favor to review a PR. One issue is though that some of our components 
might explicitly call {{mvn.cmd}}.

> Native support for powershell to start maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for powershell to start maven

2022-09-19 Thread Jurrian Fahner (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17606731#comment-17606731
 ] 

Jurrian Fahner commented on MNG-7541:
-

* The readability of the script can be improved because powershell is more 
feature rich.
 * It enables writing unit tests (this will improve readability and may also 
lower the barrier to entry): [https://pester.dev/]
 * Powershell is available since windows 7. Windows 10 and/or 11 are nowadays 
the base for many developer laptops/PCs.
 * We can get rid of cmd.exe script and replace it with powershell (which 
lowers maintainability effort), the mvn.cmd script will hold something like: 
PowerShell.exe -command mvn.ps1

It will likely not have a life altering impact probably... ;)

> Native support for powershell to start maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7541) Native support for powershell to start maven

2022-09-19 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17606466#comment-17606466
 ] 

Michael Osipov commented on MNG-7541:
-

I have tought about this and the only benefit I see is that variables aren't 
automatically exported. What else?

> Native support for powershell to start maven
> 
>
> Key: MNG-7541
> URL: https://issues.apache.org/jira/browse/MNG-7541
> Project: Maven
>  Issue Type: Improvement
>  Components: Command Line
>Affects Versions: 3.8.3
> Environment: windows 10 / 11
>Reporter: Jurrian Fahner
>Priority: Trivial
>  Labels: Script, Windows10, Windows11
>
> Maven has two files in the bin dir:
> ||command||its use||
> |mvn|POSIX shell|
> |mvn.cmd|cmd.exe|
> On windows there are two ways to write scripts, by using cmd.exe or using 
> powershell.
> If you enter mvn in powershell it will look for `mvn.ps1` on the PATH first. 
> If it doesn't find anything it will execute `mvn.cmd` as fall-back.
> When running maven for starting a server for development purposes and you do 
> ctrl-c to exit the server it will ask the question: Terminate batch job (Y/N)?
> As far as I know it is default behaviour of cmd.exe.
> Well if I don't want to terminate, I wouldn't press ctrl-c. ;)
> It is not the case (as far as I know that Microsoft is going to deprecate 
> cmd.exe in favor of powershell: 
> [https://devblogs.microsoft.com/commandline/rumors-of-cmds-death-have-been-greatly-exaggerated/]
> Allthough I think it would be a good move for maven to have also a powershell 
> script as well... It is possible to integrate elegant support for native help 
> in powershell, `get-help mvn`.
> But it also increases the maintenance effort as well. I don't know whether 
> this cost outweigh the benefits, though...
> By the way I would happy to contribute if it is appreciated.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)