Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate hibernate.properties resource #10526

Merged
merged 4 commits into from
Jul 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;

Expand All @@ -17,8 +17,6 @@
*/
public class QuarkusEnvironment {

private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Environment.class.getName());

private static final Map GLOBAL_INITIAL_PROPERTIES;

static {
Expand All @@ -30,6 +28,13 @@ public class QuarkusEnvironment {
if (classLoader != null) {
InputStream stream = classLoader.getResourceAsStream("/hibernate.properties");
if (stream != null) {
final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Environment.class.getName());
LOG.warnf(
"The resource hibernate.properties was found in the root of your application. This configuration source is deprecated and will be removed in a future version of Quarkus, "
+
"as it's not compatible with Live Coding, multiple Persistence Units and many more cool features we have planned. Please refrain from "
+
"using it to configure your ORM and use the available configurations in application.properties (check the guide in https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_configuration). Should no configuration exist for your use case please report in: https://github.com/quarkusio/quarkus/issues/. Thank you! ");
final Properties p = new Properties();
try {
p.load(stream);
Expand All @@ -42,13 +47,12 @@ public class QuarkusEnvironment {
LOG.unableToCloseStreamError(ioe);
}
}
GLOBAL_INITIAL_PROPERTIES = p;
GLOBAL_INITIAL_PROPERTIES = Collections.unmodifiableMap(p);
} else {
LOG.propertiesNotFound();
GLOBAL_INITIAL_PROPERTIES = new HashMap();
GLOBAL_INITIAL_PROPERTIES = Collections.EMPTY_MAP;
}
} else {
GLOBAL_INITIAL_PROPERTIES = new HashMap();
GLOBAL_INITIAL_PROPERTIES = Collections.EMPTY_MAP;
}
}

Expand Down