Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367191

Summary: The commnd line argument (properties) to mvn fails on Windows
Product: z_Archived Reporter: Ramesh Gunjal <rameshg282>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3 CC: eostroukhov, igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Sample project to repro the issue
none
Debug log none

Description Ramesh Gunjal CLA 2011-12-20 09:22:50 EST
Build Identifier: 20110916

The command line arguments (-Declipse.os, -Declipse.ws, -Dmaven.repo.local ...); passed to mvn are not read properly on Windows. It works fine on Linux and Mac OSX.

I am running following commands using dos prompt on Windows 7 32-bit
> cd C:\src\sample
> mvn -Dtycho.version=0.12.0 -Dmake.destination=C:/src/built -Declipse.arch=x86 -Declipse.os=win32 -Declipse.ws=win32 -Dmaven.repo.local=C:/src/tools/maven/repository -o clean package -X

The debug log says (attaching)

[DEBUG] Using local repository at C:\src\sample\true
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\src\sample\true

Whereas I use different path in my command "-Dmaven.repo.local=C:/src/tools/maven/repository"

It seems maven is not able to read these properties properly on Windows, the string "true" is returned.

The properties -Declipse.arch/os/ws are used to identify the platform information at runtime. Those are used in my POM unde target-platform-configuration. 

It also fails without offline (-o) flag. Pasting some related part from debug log

-----------------
[DEBUG] target-platform-configuration for MavenProject: com.xxx.sample:com.xxx.sample:1.0.0.qualifier @ C:/src/sample/com.xxx.sample/pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <resolver>p2</resolver>
  <environments>
    <environment>
      <os>true</os>
      <ws>true</ws>
      <arch>true</arch>
    </environment>
  </environments>
</configuration>
-----------------


Reproducible: Always

Steps to Reproduce:
1. cd to sample directory
2. Run > mvn -Dtycho.version=0.12.0 -Dmake.destination=C:/src/built -Declipse.arch=x86 -Declipse.os=win32 -Declipse.ws=win32 -Dmaven.repo.local=C:/src/tools/maven/repository -o clean package
3.
Comment 1 Ramesh Gunjal CLA 2011-12-20 09:25:20 EST
Created attachment 208615 [details]
Sample project to repro the issue
Comment 2 Ramesh Gunjal CLA 2011-12-20 09:26:46 EST
Created attachment 208616 [details]
Debug log
Comment 3 Igor Fedorenko CLA 2011-12-20 10:06:42 EST
Out of curiosity, why do you need to explicitly specify os/ws/arch ?
Comment 4 Tobias Oberlies CLA 2012-01-02 07:52:34 EST
Could this be a name collision? Did you try to use some other variable names, e.g. ${param.os} etc.?
Comment 5 Ramesh Gunjal CLA 2012-01-04 00:59:39 EST
(In reply to comment #3)
> Out of curiosity, why do you need to explicitly specify os/ws/arch ?

used to identify the platform information at runtime, used in POM
Comment 6 Ramesh Gunjal CLA 2012-01-04 01:03:04 EST
(In reply to comment #4)
> Could this be a name collision? Did you try to use some other variable names,
> e.g. ${param.os} etc.?

Yes, it fails for any variable. Any wany I got it working by just enclosing the D parameters in double quotes. E.g.

> mvn "-Dtycho.version=0.12.0" "-Dmake.destination=C:/src/built" "-Declipse.arch=x86" "-Declipse.os=win32"
Comment 7 Tobias Oberlies CLA 2012-01-04 04:16:14 EST
Then I suppose that this was a problem with the Windows command prompt and not Maven or Tycho.