• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Class path precedence

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether jar's meta class path ( test.properties ) or Spring <property name="location" value="classpath:/test.properties"/> takes higher precedence ?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand the question. Higher precedence with what? Give me an example use case.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether jar's meta class path ( test.properties ) or Spring <property name="location" value="classpath:/test1.properties"/> takes higher precedence ?

Which one loads first ?


 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Repeating the same thing twice and bolding it does not help me understand you any better.

I am going to guess you are building a Spring jar project, and test.properties is part of the project and is being bundled in the JAR. I am guessing this, because you have not told me any more details after I asked for clarification.

This bit here



Looks at the root of your jar for test.properties. There will be only one because otherwise they would overwrite each other as they would have the same name.

I still don't know what you mean by meta class path. If you mean the META-INF directory then you would have to access that property like this:



So there would be no collision.

If you are asking something totally different it sounds like you could easily run a test put different values in each location in your test.properties and see which one gets loaded.
 
reply
    Bookmark Topic Watch Topic
  • New Topic