Closed hamburml closed 3 years ago
/cc @radcortez
I like the general idea that such things usually should not end up in the "productive" artifact. A few remarks:
src/test/resources/application.properties
(for Maven) and so it will not end up in the jarapplication-dev.properties
(but I don't see a parameter in the build plugin/mojo to exclude files, /cc @aloubyansky)I'm not totally convinced about this.
While it is true that both dev
and test
are active by default on quarkus:dev
or when running a test, it is also perfectly valid to activate any of these profiles (or even a custom one) in the final package or runner. While I understand the request, I fear that we may be removing something that some users may be using.
My recommendation is to use the profile aware file application-test.properties
, application-dev.properties
and place those files outside main/resources
. Quakus also looks like from an external config
folder and the test properties may be placed in src/test/resources
.
For reference:
https://quarkus.io/version/main/guides/config-reference#application-properties-file
https://quarkus.io/version/main/guides/config-reference#profile-aware-files
If you choose the profile-aware-files approach, you can also use ignoredEntries
to filter those profile config files out from the uber-jar, e.g.
<configuration>
<uberJar>true</uberJar>
<ignoredEntries>
<ignoredEntry>META-INF/BC2048KE.SF</ignoredEntry>
<ignoredEntry>META-INF/BC2048KE.DSA</ignoredEntry>
<ignoredEntry>META-INF/BC1024KE.SF</ignoredEntry>
<ignoredEntry>META-INF/BC1024KE.DSA</ignoredEntry>
</ignoredEntries>
</configuration>
I'll check out the profile aware files and ignoredEntry
, thanks!
@hamburml does it work?
I'm inclined to close this because as @radcortez wrote it might be really fragile to remove config like this.
I'm closing this. Please open a new issue in case the `ignoredEntry``solution doesn't work for you.
Description
Quarkus uses dev and test configuration profiles (https://quarkus.io/guides/config). When we package the application inside a jar (uber-jar for example) the %dev and %test values are still in the application.properties.
I think it would be better if the %dev and %test config values are automatically removed. It's cleaner and if other developers, departments or simply third parties get the jar-file they cannot read the properties. The test-URLs or dev-credentials are not made public.
Implementation ideas
Maybe clear all %dev and %test values from the application.properties after it was copied to the target-folder.