• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

properties in the same folder

 
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I need a relative path in order to say my app that my properties file is in the same folder that the report which read them

I have a POM.xml and in there I have written something like

<report.receipt.properties.file.name></report.receipt.properties.file.name>

Any idea, please?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you express the directory in relation to your project root (basedir)?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the nature of this properties file? Is it used as part of the build process or is it used in the product that is produced?

Maven has an extreme dislike for absolute file paths when they're used by Maven itself. Maven was designed in such a way that if you do a "mvn clean" to remove superflous files, zip up the project directory, email it to someone on the other side of the planet, that the unzipped copy should be immediately buildable regardless of what OS or filesystem arrangements the recipient has. All Maven source paths are designed to be located at or below the project directory.

For a properties file used by the product of a Maven build, Maven could not care less where it's located nor whether the path is relative or absolute. That part is left up to whatever application installation process is used.
 
reply
    Bookmark Topic Watch Topic
  • New Topic