-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
When you are at dev mode and you have a file at the root of the project a .env file, the file is not loaded as the root directory at runtime is at target/.
A possible workaround is to use:
<build>
<resources>
<resource>
<directory>${project.basedir}</directory><!-- from -->
<targetPath>${project.build.directory}</targetPath><!-- to -->
<includes><!-- what -->
<include>**/.env</include>
</includes>
</resource>
</resources>
</build>
But we could integrate this on dev mode so if there is a .env the file then we copy directly to target (I don't know if this is possible).
I know that the purpose of a .env is to reside outside of the project (JAR/native package) but I am thinking in the next use case:
I am demoing in front of a big audience, I have my .env file with my credentials to publish a docker image to quai. Then I can just say look I copy this file into root project as it has my credentials and of course, you cannot see them, and then I run mvn .... and the image is published.
I could copy directly to target/ directory it is true, but if I do a clean then I will miss everything.
So it will be great at the plugin level to do this copy instead of having to configure pom.xml with the resources and explain to the audience why I am doing this.