Eclipse: Referencing log4j.dtd in log4j.xml

I know this question has been answered, but I’d like to provide my slightly different alternative: <!DOCTYPE log4j:configuration PUBLIC “-//APACHE//DTD LOG4J 1.2//EN” “http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd”> It is similar to @FrVaBe’s response, but on the plus side, does not require any further Eclipse configuration (i.e., if you’re sharing your project with others, or have a large team, it’s … Read more

Is it possible to override the configuration of a plugin already defined for a profile in a parent POM?

Overriding configurations from a parent pom can be done by adding the combine.self=”override” attribute to the element in your pom. Try changing your plugin configuration to: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <id>my-testCompile</id> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> <configuration combine.self=”override”> <fork>true</fork> <executable>${jdk15.executable}</executable> <compilerVersion>1.5</compilerVersion> <source>1.5</source> <target>1.5</target> <verbose>true</verbose> </configuration> </execution> </executions> </plugin> For more information on overriding plugins, see: … Read more

Where did Configuration.generateSchemaCreationScript() go in Hibernate 5

Thanks to the answers by Vlad and Gunnar, I’ve managed to find my way through the new configuration API to produce the equivalent export logic with the following. Of course, history shows that this API will break again, so make sure to choose the appropriate version: Hibernate 5.2: MetadataSources metadata = new MetadataSources( new StandardServiceRegistryBuilder() … Read more

How to specify Log4J 2.x config location?

You could use the static method #initialize(String contextName, ClassLoader loader, String configLocation) (see source here) in org.apache.logging.log4j.core.config.Configurator. (You can pass null for the class loader.) Be aware that this class is not part of the public API so your code may break with any minor release. For completeness, you can also specify the location of … Read more

Correct implementation of a custom config section with nested collections?

I finally found this guy’s example. It was coded and worked right out of the box. http://manyrootsofallevilrants.blogspot.com/2011/07/nested-custom-configuration-collections.html I am going to paste the code here……only because I cannot stand it when someone says “Your answer is here”, and the link is dead. Please try his website first, and leave a “thank you” if it works. … Read more