Overriding path properties when executing SolrMarc.jar

19 views
Skip to first unread message

matt mitchell

unread,
Jan 19, 2010, 5:28:50 PM1/19/10
to solrmarc-tech
Any possibility of adding the ability for SolrMarc.jar to recognize
these settings when your executing?

solrmarc.solr.war.path
solr.path
solr.indexer.properties
solr.hosturl = http://localhost:8983/solr/update

java -jar -D.solr.path=xxx -D.solrmarc.solr.war.path=xxx SolrMarc.jar

With that, how about when a relative path is given, the current
working directory is used as a base? Maybe it does that already
though...

Matt

Jonathan Rochkind

unread,
Jan 20, 2010, 11:36:03 AM1/20/10
to solrma...@googlegroups.com
SolrMarc _will_ recognize those -- it's just that if you ALSO have those
defined in a config.properties, SolrMarc applies those _on top_ of the
initially set java properties, so the config.properties takes precedence.

So i guess what Matt wants is for, when loading config.properties, NOT
to over-ride anything that's been set as a java property on the command
line? Not sure how do-able that is.

As far as relative paths... so, bieng relative to the current working
directory is indeed what it USED to do. I never liked it -- when
writing a config file, it working should not be dependent on the user
executing having a certain working directory when executing. I think
that's really bad style, is not what the user would expect, curious why
you want it.

However, what it was changed to is having a "search path", a list of
directories to search to resolve relative paths. The order they are
listed in the search path the first place a resolution is found, it's
used. I am not sure if the current working directory is currently in
the search path. You can add on to (or over-ride? I forget) the search
paths yourself with the solrmarc.site.path java property. So perhaps
you could do this on the command line like "... -Dsolrmarc.site.path
=`pwd` ... ". Note again that if solrmarc.site.path is specified in the
config.properties though, I think it'll end up ignoring what you say on
the command line. (Note that the standard Java way of passing java
properties on the command line is -Dname.of.property. Note no space or
full stop between the D and the name of the property. It's a weird
convention, but it's what Java does.)

Jonathan

Robert Haschart

unread,
Jan 21, 2010, 12:49:53 PM1/21/10
to solrma...@googlegroups.com
All of these should already be possible. Properties defined on the java
comand line take precedence over any definition of that property in the
config.properties file. Note: A recent response from Jonathan indicates
that properties on the command line taking precedence might not be the
case, however it should work that way. I'll look into it and see
whether a recent change broke that particular feature.

However you do have the syntax slightly wrong:

java -jar -Dsolr.path=xxx -Dsolrmarc.solr.war.path=xxx SolrMarc.jar

Jonathan Rochkind

unread,
Jan 21, 2010, 12:59:01 PM1/21/10
to solrma...@googlegroups.com
It's also possible I was doing something weird when I tried it. I
_think_ when I tried it the properties file ended up over-riding the
command line properties.

Matt Mitchell

unread,
Jan 21, 2010, 1:03:48 PM1/21/10
to solrma...@googlegroups.com
OK thanks Bob. Sorry I should have tested this out before asking! So, can you override all of the properties in the command line?

Matt

--
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To post to this group, send email to solrma...@googlegroups.com.
To unsubscribe from this group, send email to solrmarc-tec...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrmarc-tech?hl=en.



matt mitchell

unread,
Feb 9, 2010, 4:04:59 PM2/9/10
to solrmarc-tech
I've confirmed Bobs claims to be true. You *can* override the SolrMarc
properties from the command line.

Matt

On Jan 21, 1:03 pm, Matt Mitchell <goodie...@gmail.com> wrote:
> OK thanks Bob. Sorry I should have tested this out before asking! So, can
> you override all of the properties in the command line?
>
> Matt
>
> On Thu, Jan 21, 2010 at 12:49 PM, Robert Haschart <rh...@virginia.edu>wrote:
>
> > All of these should already be possible.  Properties defined on the java
> > comand line take precedence over any definition of that property in the
> > config.properties file.  Note: A recent response from Jonathan indicates
> > that properties on the command line taking precedence might not be the case,
> > however it should work that way.   I'll look into it and see whether a
> > recent change broke that particular feature.
>
> > However you do have the syntax slightly wrong:
>
> > java -jar -Dsolr.path=xxx -Dsolrmarc.solr.war.path=xxx SolrMarc.jar
>
> > matt mitchell wrote:
>
> >  Any possibility of adding the ability for SolrMarc.jar to recognize
> >> these settings when your executing?
>
> >> solrmarc.solr.war.path
> >> solr.path
> >> solr.indexer.properties

> >> solr.hosturl =http://localhost:8983/solr/update


>
> >> java -jar -D.solr.path=xxx -D.solrmarc.solr.war.path=xxx SolrMarc.jar
>
> >> With that, how about when a relative path is given, the current
> >> working directory is used as a base? Maybe it does that already
> >> though...
>
> >> Matt
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "solrmarc-tech" group.
> > To post to this group, send email to solrma...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > solrmarc-tec...@googlegroups.com<solrmarc-tech%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages