You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Billy Newman <ne...@gmail.com> on 2013/01/14 21:57:49 UTC

Escape '*' in property command line

Using maven 2.

I am trying to pass a cron expression as a property in a maven build.

mvn clean install -Dcron-expression="0 0 23 * * *"

However it looks like the maven script is doing something funky with
the '*' characters before actually passing them off to java.  I
actually get a directory listing of the current directory in which the
pom is executing.

I have tried escaping to no avail.

Anyone run into this before?

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Escape '*' in property command line

Posted by Billy Newman <ne...@gmail.com>.
I have with no luck. 

The problem with escaping is that I have spaces in the arg. With spaces seems like the correct way is to surround the arg in qoutes. 
-Dcron="0 0 23 * * *"

Which should work. If I add escape chars within the string those escape chars are passed as part of the property itself instead of being removed from the final string. 

That brought me to escaping the spaces too. 
-Dcron=0\ 0\ 23\ \*\ \*\ \*

That also did not work. Performed the same way wrapping in qoutes. 

Lastly the strange thing is one * works just fine. 
-Dcron="0 0 23 *"

It is the presence of more than one * that starts to cause problems. 

Billy

On Jan 15, 2013, at 2:28 AM, "Thorsten Heit" <th...@vkb.de> wrote:

> Hi,
> 
>> I did try single quotes, unfortunately that did not work either.
>> 
>> I modified the maven script to print out is quoted args variable,
>> looks like it did some sort of filename expansion with the '*'
>> character.
>> 
>> When I perform:
>> echo "0 0 23 * * *" I get:
>> 0 0 23 * * *, as one would expect.
>> 
>> Seems like a bug in the maven script that is creating the QUOTED_ARGS
>> variable at the beginning of the script.
> 
> Have you tried to escape the "*" with a backslash, i.e. '\*'?
> 
> 
> HTH
> 
> Thorsten

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Re: Escape '*' in property command line

Posted by Thorsten Heit <th...@vkb.de>.
Hi,

> I did try single quotes, unfortunately that did not work either.
> 
> I modified the maven script to print out is quoted args variable,
> looks like it did some sort of filename expansion with the '*'
> character.
> 
> When I perform:
> echo "0 0 23 * * *" I get:
> 0 0 23 * * *, as one would expect.
> 
> Seems like a bug in the maven script that is creating the QUOTED_ARGS
> variable at the beginning of the script.

Have you tried to escape the "*" with a backslash, i.e. '\*'?


HTH

Thorsten

Re: Escape '*' in property command line

Posted by Billy Newman <ne...@gmail.com>.
I did try single quotes, unfortunately that did not work either.

I modified the maven script to print out is quoted args variable,
looks like it did some sort of filename expansion with the '*'
character.

When I perform:
echo "0 0 23 * * *" I get:
0 0 23 * * *, as one would expect.

Seems like a bug in the maven script that is creating the QUOTED_ARGS
variable at the beginning of the script.

Billy

On Mon, Jan 14, 2013 at 2:01 PM, Curtis Rueden <ct...@wisc.edu> wrote:
> Hi Billy,
>
>> I actually get a directory listing of the current directory in which
>> the pom is executing.
>
> That sounds more like your shell is interpreting the asterisks as globs.
>
> Did you try it with single quotes instead of double quotes?
>
> -Curtis
>
>
> On Mon, Jan 14, 2013 at 2:57 PM, Billy Newman <ne...@gmail.com> wrote:
>
>> Using maven 2.
>>
>> I am trying to pass a cron expression as a property in a maven build.
>>
>> mvn clean install -Dcron-expression="0 0 23 * * *"
>>
>> However it looks like the maven script is doing something funky with
>> the '*' characters before actually passing them off to java.  I
>> actually get a directory listing of the current directory in which the
>> pom is executing.
>>
>> I have tried escaping to no avail.
>>
>> Anyone run into this before?
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Escape '*' in property command line

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Billy,

> I actually get a directory listing of the current directory in which
> the pom is executing.

That sounds more like your shell is interpreting the asterisks as globs.

Did you try it with single quotes instead of double quotes?

-Curtis


On Mon, Jan 14, 2013 at 2:57 PM, Billy Newman <ne...@gmail.com> wrote:

> Using maven 2.
>
> I am trying to pass a cron expression as a property in a maven build.
>
> mvn clean install -Dcron-expression="0 0 23 * * *"
>
> However it looks like the maven script is doing something funky with
> the '*' characters before actually passing them off to java.  I
> actually get a directory listing of the current directory in which the
> pom is executing.
>
> I have tried escaping to no avail.
>
> Anyone run into this before?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>