Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi-registry/pull/10#discussion_r140073712
--- Diff:
nifi-registry-web-api/src/main/java/org/apache/nifi/registry/NiFiRegistryApiApplication.java
---
@@ -14,27 +14,41 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.nifi.registry.web;
+package org.apache.nifi.registry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
-import org.springframework.context.annotation.ComponentScan;
+
+import java.util.Properties;
/**
* Main class for starting the NiFi Registry Web API as a Spring Boot
application.
*
- * By default, Spring Boot will only scan in the package this class is
located in, so we set
- * @ComponentScan to the common parent package to find beans in other
packages.
+ * This class is purposely in the org.apache.nifi.registry package since
that is the common base
+ * package across other modules. This is done because spring-boot will use
the package of this
+ * class to automatically scan for beans/config/entities/etc. and would
otherwise require
+ * configuring custom packages to scan in several different places.
*/
@SpringBootApplication
-@ComponentScan("org.apache.nifi.registry")
public class NiFiRegistryApiApplication extends
SpringBootServletInitializer {
+ public static final String NIFI_REGISTRY_PROPERTIES_ATTRIBUTE =
"nifi-registry.properties";
+
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder
application) {
- return application.sources(NiFiRegistryApiApplication.class);
+ final Properties fixedProps = new Properties();
+ fixedProps.setProperty("spring.jpa.hibernate.ddl-auto", "none");
+
fixedProps.setProperty("spring.jpa.hibernate.naming.physical-strategy",
"org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl");
+
+ // turn on to debug
+ fixedProps.setProperty("spring.jpa.show-sql", "true");
+ fixedProps.setProperty("spring.h2.console.enabled", "true");
--- End diff --
The way I thought this was working was that even with those set to true,
the logging didn't take place unless you also changed the levels in logback.xml
as mentioned in your next comment, but apparently that is not true since you
saw the output in bootstrap.log :)
---