Skip to content

Only-Script Powershell Bugs #346

Closed as duplicate
Closed as duplicate

Description

@bohni

Affected version

3.3.2

Bug description

The Powershell part of the only-mvnw.cmd contains tweo bugs:

  1. if statement is reversed - should be if(! $USE_MVND) (or if and else part must be swapped)
    $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
  2. The compounded regex pattern does not work. Must be "^.*$MVNW_REPO_PATTERN"
    $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"

This works for me:

  $MVNW_REPO_PATTERN = if (!$USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
  $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions