Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 251213 - new maven command line extension for windows change from .bat to .cmd
new maven command line extension for windows change from .bat to .cmd
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Maven
8.1
PC Windows 7
: P2 with 1 vote (vote)
: 8.1
Assigned To: Tomas Stupka
issues@projects
https://jira.codehaus.org/browse/MNG-...
:
: 251273 251380 251487 251534 252442 253038 253627 (view as bug list)
Depends on:
Blocks: 253246
  Show dependency treegraph
 
Reported: 2015-03-16 16:42 UTC by skygo
Modified: 2016-09-18 14:00 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
patch for windows command line (10.29 KB, patch)
2015-03-16 16:42 UTC, skygo
Details | Diff
mock maven jar (2.81 KB, application/x-zip-compressed)
2015-03-18 17:06 UTC, skygo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description skygo 2015-03-16 16:42:21 UTC
Created attachment 152656 [details]
patch for windows command line

Hi,
  I was testing new maven binaries (3.3.0 (release was cancel)  and 3.3.1 (release on progress)) on windows but the maven command line was not found.

This is because of end of old windows batch file support [1] for future maven version. (move from .bat to .cmd

I try to create a patch for resolving this issue.
 I added a limited unit test with hack to be able to call a protected method (resetOperatingSystem) in BaseUtilities in order faint the os detection.
 I also populate a few jar containings pom.properties at good folder to ensure detection was ok.

Regards

[1] https://jira.codehaus.org/browse/MNG-5776
Comment 1 Tomas Stupka 2015-03-17 13:34:49 UTC
thanks for the patch. will apply asap ...
Comment 2 Tomas Stupka 2015-03-17 19:19:38 UTC
fixed in jet-main #96f725785a9c
Comment 3 skygo 2015-03-18 17:06:44 UTC
Created attachment 152698 [details]
mock maven jar

I'am not sure of the cryptic commit diff for the jars uses in the tests. I pass them as zip file in case it need to be scan.

thanks for applying
Comment 4 Tomas Stupka 2015-03-18 17:27:32 UTC
> I'am not sure of the cryptic commit diff for the jars uses in the tests. I pass them as zip file in case it need to be scan.
completely missed that, thanks ...
Comment 5 Quality Engineering 2015-03-19 03:35:22 UTC
Integrated into 'main-silver', will be available in build *201503190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/96f725785a9c
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #251213 - new maven command line extension for windows change from .bat to .cmd
Comment 6 Tomas Stupka 2015-03-19 09:33:38 UTC
*** Bug 251273 has been marked as a duplicate of this bug. ***
Comment 7 tanyehzheng 2015-03-19 09:43:51 UTC
Comment on attachment 152656 [details]
patch for windows command line

Can we just check for the existence of the mvn.bat file to determine whether to execute mvn.bat or mvn.cmd?
I think it'll be more clear and faster than MavenSettings.getCommandLineMavenVersion(mavenHome)
Comment 8 Tomas Stupka 2015-03-19 10:22:10 UTC
(In reply to tanyehzheng from comment #7)
> Comment on attachment 152656 [details]
> patch for windows command line
> 
> Can we just check for the existence of the mvn.bat file to determine whether
> to execute mvn.bat or mvn.cmd?
> I think it'll be more clear and faster than
> MavenSettings.getCommandLineMavenVersion(mavenHome)

Once .getCommandLineMavenVersion is called all subsequent calls are usually fast (measured on my laptop it got down somewhere between 5 - 40ms). Considering that and also the fact that it has to be called at other places during mvn execution anyway, it seems to be better to stay with a clean semantic instead of a potentially dangerous and misleading guess-like heuristic.

also that in case .getCommandLineMavenVersion turns out to be a significant performance problem, we should consider caching the mvn version
Comment 9 tanyehzheng 2015-03-19 10:46:51 UTC
Thanks for your explanation.
Comment 10 Tomas Stupka 2015-03-23 16:56:41 UTC
*** Bug 251380 has been marked as a duplicate of this bug. ***
Comment 11 Tomas Stupka 2015-03-30 10:59:43 UTC
*** Bug 251487 has been marked as a duplicate of this bug. ***
Comment 12 Tomas Stupka 2015-03-31 16:40:53 UTC
*** Bug 251534 has been marked as a duplicate of this bug. ***
Comment 13 Tomas Stupka 2015-05-17 17:55:59 UTC
*** Bug 252442 has been marked as a duplicate of this bug. ***
Comment 14 Tomas Stupka 2015-06-17 08:41:47 UTC
*** Bug 253038 has been marked as a duplicate of this bug. ***
Comment 15 hanasaki 2015-06-29 17:31:25 UTC
Nightly verified working.
Current 8.0.2 cannot be used with current maven release 3.3.3 or other released maven versions that have needed bug fixes.
Request the fix in nightly be backported to 8.0.2 and released has 8.0.2.1
Comment 16 sjnewbold 2015-08-05 01:09:08 UTC
Tested Maven 3.3.3 with NB 8.0.2. A workaround is to do the following 2 steps.

1. rename mvn.cmd to mvn.bat
2. edit line 100 and rename mvn.cmd to mvn.bat
Comment 17 Antonin Nebuzelsky 2015-09-10 10:41:26 UTC
*** Bug 253627 has been marked as a duplicate of this bug. ***
Comment 18 javatlacati 2015-12-03 23:29:40 UTC
Same happends with Maven 3.3.9
Comment 19 Tomas Stupka 2015-12-04 10:28:06 UTC
> Same happends with Maven 3.3.9
i have to ask to be sure - what NB version/build do you use

please also attach your messages.log from a NB session in which you reproduced this problem

thanks
Comment 20 Tomas Stupka 2015-12-23 13:56:23 UTC
no response for a couple of weeks. 
this was fixed in march and should be fixed in 8.1. closing for now.

feel free to reopen in case this is reproducible with a current dev build or 8.1 or higher


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo