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
This commit is contained in:
parent
e7b42897da
commit
68da970f86
98
Fix.java
98
Fix.java
@ -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 );
|
||||
}
|
||||
}
|
||||
63
Fix2.java
63
Fix2.java
@ -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 );
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user