Re: Setting framework property at command line
On Tue, Nov 5, 2013 at 7:36 PM, Felix Meschberger wrote: > This is obviously wrong and must be fixed. Created the issue SLING-3231 [1] for this. For now the patch just creates the key in parseCommandLine like Da1 regards Chetan [1] https://issues.apache.org/jira/browse/SLING-3231 Chetan Mehrotra
Re: Setting framework property at command line
Hi Yes, this is a bug in the Main.parseCommandLine method: This iterates the command line and creates a map where the parameters are the keys and the parameter values are the values. This folds all -D parameters into a single key-value pair just sticking with the last. This is obviously wrong and must be fixed. This should really keep all potentially duplicate arguments instead of just overwriting them — or even better maybe merge the parseCommandLine and convertCommandLineArg methods thus only iterating over the command line once instead of twice. Regards Felix — Felix Meschberger | Principal Scientist | Adobe Am 05.11.2013 um 14:09 schrieb Chetan Mehrotra : > Hi, > > Looking at Sling Launchpad docs [1] it mentions that one can set > framework property via -D n=v pair. I tried passing multiple > properties like > > * -D a1=b1 -D a2=b2 > * -Da1=b1 -Da2=b2 > > In both cases only the last property is set while the others are > ignored. is there any other way it should be set? > > Also looking at the command line parsing logic it appears that it > probably does not handle such multiple properties [2] that well. So > wanted to confirm if anyone has been able to pass multiple framework > property via command line > > Chetan Mehrotra > [1] > http://sling.apache.org/documentation/the-sling-engine/the-sling-launchpad.html > [2] > https://github.com/apache/sling/blob/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/app/Main.java#L121