what will happen if you put it under quotes '-Dprop1=${prop2}' ? --sony On Fri, Apr 22, 2011 at 10:40 PM, Phillip Hellewell <ssh...@gmail.com>wrote:
> I appreciate the two responses, but no one seems to be grasping what > I'm talking about. > > Erase from your mind anything about %dos_env_vars% or $unix_env_vars. > My question has exactly 0 to do with env vars. > > My question is about maven properties. In a pom file I can set a > property to the value of another property by writing > <prop1>${prop2}<prop1>, or if I want to set it to the literal value > "${prop2}" I can write <prop1>$${prop2}<prop1>. The extra $ escapes > it and keeps it from getting interpolated. > > However, on the command-line, I cannot find any way to accomplish the > same thing. If I write mvn blah -Dprop1=${prop2} Maven sets prop1 to > null. If I write mvn blah -Dprop1=$${prop2} it sets prop1 to $null. > The only way I have found to keep it from interpolating is by > appending text. > > Is this by design or a bug? I'd say it is a bug because if it's going > to interpolate at all it ought to be consistent and should work the > same way as when inside a pom file. > > Phillip > > On Thu, Apr 21, 2011 at 6:16 PM, Sony Antony <sony.ant...@gmail.com> > wrote: > > I think %myvar2% will result in windows shell doing teh substitution > > I dont think maven will use system variables set using -D as pom > variables ( > > maybe I m wrong ) > > --sony > > On Thu, Apr 21, 2011 at 7:24 PM, Phillip Hellewell <ssh...@gmail.com> > wrote: > > > >> This is on Windows from a command prompt, not Linux. > >> > >> Phillip > >> > >> On Thu, Apr 21, 2011 at 12:21 PM, Jörg Schaible <joerg.schai...@gmx.de> > >> wrote: > >> > Phillip Hellewell wrote: > >> > > >> >> Oh, I just thought of something shorter that will work: > >> >> > >> >> -Dmyvar1=c:\test\${myvar2}\. > >> >> > >> >> Still seems kinda crazy though. Anyone want to shed some light on > why > >> >> it works this way? This is with Maven 3.0.1. > >> > > >> > Maybe you should have a look into the bash manual instead ? > >> > > >> > - Jörg > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > >> > For additional commands, e-mail: users-h...@maven.apache.org > >> > > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > >> For additional commands, e-mail: users-h...@maven.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >