As part of a Spring Boot project I need to load certain properties file which, by default, is located under de `src/main/resources` directory. Also, I need to be able to, instead, load an external properties file (located at the root directory of the project). If this external file exists, the file path should be passed as command line property.

The file structure would be like this:

```
/app_project
   Net.properties (external file)
   /src
      /main
         /resources
            Net.properties (default file)

```

The thing is that the dependency that makes use of those properties wouldn't work *unless* you copy/overwrite the contents of the external file into the file under the `/resources` directory.

**UPDATED**

So far I've tried: 

* loading the file as an external resource and loading it into a Properties object (<https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html>)
* saving the properties as System Properties
* modifying the resource handler to look into other directories by overriding th `addResourceHandlers()` to include the location
* Explicitly including the location of the file in the CLASSPATH with the `-cp argument` (as @veysiertekin suggested)
* Loading it as a @PropertySource (as suggesed by @Nikolay Shevchenko)
* Overriding the *Spring Boot's config location* with the `spring.config.location` (as suggested by @gWombat)

With all these methods I've tried, the file is indeed read and loaded but, at some point, and every time, the app resorts to the file under `src/main/resources` .

I suspect it may have to do with the precedence of the file (as described here <https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html>), but I just couldn't figure out what's happening.

Thanks in advance for your help.