Use pretty printing
authorChristian Schneider <chris@die-schneider.net>
Tue, 26 Apr 2016 07:05:03 +0000 (09:05 +0200)
committerChristian Schneider <chris@die-schneider.net>
Tue, 26 Apr 2016 07:05:03 +0000 (09:05 +0200)
samples/jpa/.gitignore [new file with mode: 0644]
starters/karaf-boot-starter-jpa/pom.xml
starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/impl/JpaProcessor.java

diff --git a/samples/jpa/.gitignore b/samples/jpa/.gitignore
new file mode 100644 (file)
index 0000000..c71ea97
--- /dev/null
@@ -0,0 +1 @@
+/.apt_generated/
index 734714b..7a89d90 100644 (file)
@@ -30,7 +30,6 @@
             <artifactId>geronimo-jpa_2.0_spec</artifactId>
             <version>1.1</version>
         </dependency>
-        <!-- 
         <dependency>
             <groupId>net.java.dev.stax-utils</groupId>
             <artifactId>stax-utils</artifactId>
@@ -42,7 +41,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-         -->
 
         <dependency>
             <groupId>junit</groupId>
index ed52850..f257238 100644 (file)
@@ -25,6 +25,8 @@ import org.apache.karaf.boot.jpa.PersistentUnit;
 import org.apache.karaf.boot.jpa.Property;
 import org.apache.karaf.boot.jpa.Provider;
 
+import javanet.staxutils.IndentingXMLStreamWriter;
+
 public class JpaProcessor extends AbstractProcessor {
 
     public JpaProcessor() {
@@ -60,8 +62,7 @@ public class JpaProcessor extends AbstractProcessor {
     public void process(Writer writer, Map<PersistentUnit, List<? extends AnnotationMirror>> units) throws Exception {
         Set<String> puNames = new HashSet<String>();
         XMLOutputFactory xof =  XMLOutputFactory.newInstance();
-        //XMLStreamWriter w = new IndentingXMLStreamWriter(xof.createXMLStreamWriter(writer));
-        XMLStreamWriter w = xof.createXMLStreamWriter(writer);
+        XMLStreamWriter w = new IndentingXMLStreamWriter(xof.createXMLStreamWriter(writer));
         w.setDefaultNamespace("http://java.sun.com/xml/ns/persistence");
         w.writeStartDocument();
         w.writeStartElement("persistence");