From 68da970f8615b68eac7ef5b1021dccc4e10b5e40 Mon Sep 17 00:00:00 2001 From: aheritier Date: Sun, 5 Feb 2006 23:11:33 +0000 Subject: [PATCH] Remove old classes used to fix POMs git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@375131 13f79535-47bb-0310-9956-ffa450edef68 --- Fix.java | 98 ------------------------------------------------------- Fix2.java | 63 ----------------------------------- 2 files changed, 161 deletions(-) delete mode 100644 Fix.java delete mode 100644 Fix2.java diff --git a/Fix.java b/Fix.java deleted file mode 100644 index 16a8e003..00000000 --- a/Fix.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ==================================================================== - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -import org.dom4j.*; -import org.dom4j.io.*; -import java.io.*; -import java.util.*; - -public class Fix -{ - public static void main( String[] args ) - throws Exception - { - SAXReader r = new SAXReader(); - - Document d = r.read( new FileReader( args[0] ) ); - - Element root = d.getRootElement(); - - Element deps = root.element( "dependencies" ); - - for ( Iterator i = deps.elementIterator( "dependency" ); i.hasNext(); ) - { - Element e = (Element) i.next(); - - Element id = e.element( "id" ); - - if ( id != null ) - { - String text = id.getText(); - - id.detach(); - - e.addElement( "groupId" ).addText( text ); - - e.addElement( "artifactId" ).addText( text ); - - Element v = e.element( "version" ); - - v.detach(); - - e.add( v ); - - Element u = e.element( "url" ); - - if ( u != null ) - { - u.detach(); - - e.add( u ); - } - - Element p = e.element( "properties" ); - - if ( p != null ) - { - p.detach(); - - e.add( p ); - } - } - } - - File f = new File( args[0] ); - - f.delete(); - - OutputStream os = new FileOutputStream( args[0] ); - - OutputFormat format = new OutputFormat(); - - format.setIndentSize( 2 ); - - format.setNewlines( true ); - - format.setTrimText( true ); - - XMLWriter writer = new XMLWriter( format ); - - writer.setOutputStream( os ); - - writer.write( d ); - } -} diff --git a/Fix2.java b/Fix2.java deleted file mode 100644 index d6a37ba2..00000000 --- a/Fix2.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ==================================================================== - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -import org.dom4j.*; -import org.dom4j.io.*; -import java.io.*; -import java.util.*; - -public class Fix2 -{ - public static void main( String[] args ) - throws Exception - { - SAXReader r = new SAXReader(); - - Document d = r.read( new FileReader( args[0] ) ); - - Element root = d.getRootElement(); - - Element id = root.element( "id" ); - - if ( id != null ) - { - System.out.println( id.getName() ); - - id.setName( "artifactId" ); - } - - File f = new File( args[0] ); - - f.delete(); - - OutputStream os = new FileOutputStream( args[0] ); - - OutputFormat format = new OutputFormat(); - - format.setIndentSize( 2 ); - - format.setNewlines( true ); - - format.setTrimText( true ); - - XMLWriter writer = new XMLWriter( format ); - - writer.setOutputStream( os ); - - writer.write( d ); - } -}