[MSHADE-280] - Upgrade jdom 1.1.3 to jdom2 2.0.6
authorKarl Heinz Marbaise <khmarbaise@apache.org>
Sun, 1 Apr 2018 21:58:52 +0000 (23:58 +0200)
committerKarl Heinz Marbaise <khmarbaise@apache.org>
Sun, 1 Apr 2018 22:00:40 +0000 (00:00 +0200)
pom.xml
src/main/java/org/apache/maven/plugins/shade/pom/MavenJDOMWriter.java
src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java
src/main/java/org/apache/maven/plugins/shade/resource/XmlAppendingTransformer.java

diff --git a/pom.xml b/pom.xml
index ccf236c..f90dc14 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     </dependency>
     <dependency>
       <groupId>org.jdom</groupId>
-      <artifactId>jdom</artifactId>
-      <version>1.1.3</version>
+      <artifactId>jdom2</artifactId>
+      <version>2.0.6</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
index e138769..7420ea5 100644 (file)
@@ -19,6 +19,16 @@ package org.apache.maven.plugins.shade.pom;
  * under the License.
  */
 
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.model.ActivationFile;
 import org.apache.maven.model.ActivationOS;
 import org.apache.maven.model.ActivationProperty;
@@ -62,23 +72,13 @@ import org.apache.maven.model.Resource;
 import org.apache.maven.model.Scm;
 import org.apache.maven.model.Site;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.jdom.Content;
-import org.jdom.DefaultJDOMFactory;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.Text;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import org.jdom2.Content;
+import org.jdom2.DefaultJDOMFactory;
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.Text;
+import org.jdom2.output.Format;
+import org.jdom2.output.XMLOutputter;
 
 /**
  * Class MavenJDOMWriter.
index 83161af..90dbaf5 100644 (file)
@@ -19,15 +19,15 @@ package org.apache.maven.plugins.shade.pom;
  * under the License.
  */
 
-import org.apache.maven.model.Model;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.Namespace;
-import org.jdom.output.Format;
-
 import java.io.IOException;
 import java.io.Writer;
 
+import org.apache.maven.model.Model;
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+import org.jdom2.output.Format;
+
 /**
  * @author Jason van Zyl
  */
index 6b2a3a7..5e909a7 100644 (file)
@@ -19,19 +19,6 @@ package org.apache.maven.plugins.shade.resource;
  * under the License.
  */
 
-import org.apache.maven.plugins.shade.relocation.Relocator;
-import org.jdom.Attribute;
-import org.jdom.Content;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
@@ -40,6 +27,19 @@ import java.util.List;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 
+import org.apache.maven.plugins.shade.relocation.Relocator;
+import org.jdom2.Attribute;
+import org.jdom2.Content;
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.JDOMException;
+import org.jdom2.input.SAXBuilder;
+import org.jdom2.output.Format;
+import org.jdom2.output.XMLOutputter;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
 /**
  * Appends multiple occurrences of some XML file.
  */
@@ -98,8 +98,7 @@ public class XmlAppendingTransformer
         {
             Element root = r.getRootElement();
 
-            for ( @SuppressWarnings( "unchecked" )
-            Iterator<Attribute> itr = root.getAttributes().iterator(); itr.hasNext(); )
+            for ( Iterator<Attribute> itr = root.getAttributes().iterator(); itr.hasNext(); )
             {
                 Attribute a = itr.next();
                 itr.remove();
@@ -112,8 +111,7 @@ public class XmlAppendingTransformer
                 }
             }
 
-            for ( @SuppressWarnings( "unchecked" )
-            Iterator<Content> itr = root.getChildren().iterator(); itr.hasNext(); )
+            for ( Iterator<Element> itr = root.getChildren().iterator(); itr.hasNext(); )
             {
                 Content n = itr.next();
                 itr.remove();