-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-7541] Implement powershell command #878
base: master
Are you sure you want to change the base?
Conversation
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 |
This is at least what I have, although I work from Windows Terminal with PowerShell 7 only:
I'd expect that on a Windows CI Agent only the Windows PS will be used. Thus, this should be our minimum requirement. |
Try the Maven Core ITs with this. Make sure that |
The CoreIT tests have run well. |
@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. |
@michael-o Gentle reminder |
@Giovds @michael-o This branch contains the latest improvements from #982. |
#> | ||
|
||
# set title | ||
$Host.UI.RawUI.WindowTitle = $MyInvocation.MyCommand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably has the same 'issue' as as 3.x script: #982 (comment)?
@@ -0,0 +1,83 @@ | |||
# ==== END VALIDATION ==== | |||
|
|||
$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of mvnlauncher.ps1
as it is never used in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep it identical to init.cmd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to fix the command terminal title, the rest LGTM
@Giovds 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. |
@@ -0,0 +1,83 @@ | |||
# ==== END VALIDATION ==== | |||
|
|||
$CLASSWORLDS_CONF = "$MAVEN_HOME\bin\m2.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep it identical to init.cmd
.
if (Test-Path $jvm_config) { | ||
return $env:MAVEN_OPTS + " " + -Join (Get-Content $jvm_config) | ||
} | ||
return $env:MAVEN_OPTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not correct. If the file is empty then it is empty. See approach in init
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
} | ||
} | ||
|
||
$MAVEN_OPTS = (RetrieveContentsJvmConfig $basedir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
# 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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether this is a relic from the past. In mvnvalidate
this check isn't present and this file is part of mvn
/mvn.cmd
/mvn.ps1
. How can this fail?`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If mvn.ps1
or mvn.cmd
is removed or not accessible.
But it is indeed a corner case, shall we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Following this checklist to help us incorporate your
contribution quickly and easily:
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.
[MNG-XXX] SUMMARY
, where you replaceMNG-XXX
and
SUMMARY
with the appropriate JIRA issue. Best practice is to use the JIRA issuetitle in the pull request title and in the first line of the commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement 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
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.