[
https://issues.apache.org/jira/browse/MWRAPPER-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533642#comment-17533642
]
ASF GitHub Bot commented on MWRAPPER-61:
----------------------------------------
slawekjaranowski commented on code in PR #33:
URL: https://github.com/apache/maven-wrapper/pull/33#discussion_r867683474
##########
maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java:
##########
@@ -70,8 +70,12 @@ public Path createDist( WrapperConfiguration configuration )
{
Logger.info( "Detected MVNW_REPOURL environment variable " +
mvnwRepoUrl );
String mvnPath = distributionUrl.toURL().toString();
- mvnPath = mvnPath.substring( mvnPath.indexOf( "org/apache/maven" )
);
- distributionUrl = new URI( mvnwRepoUrl ).resolve( "/" ).resolve(
mvnPath );
+ int pathIdx = mvnPath.indexOf( "org/apache/maven" );
+ if ( 0 <= pathIdx )
+ {
+ mvnPath = mvnPath.substring( pathIdx );
+ distributionUrl = new URI( mvnwRepoUrl ).resolve( "/"
).resolve( mvnPath );
+ }
Review Comment:
How it is connected with new script type?
`pathIdx` will be `-1` if there is no substring ....
> let mvnw call mvn directly, without maven-wrapper.jar
> -----------------------------------------------------
>
> Key: MWRAPPER-61
> URL: https://issues.apache.org/jira/browse/MWRAPPER-61
> Project: Maven Wrapper
> Issue Type: Improvement
> Components: Maven Wrapper Scripts
> Affects Versions: 3.1.0
> Reporter: James Z.M. Gao
> Priority: Major
> Fix For: 3.2.0
>
>
> try to skip maven-wrapper.jar, call mvn directly from mvnw.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)