*** empty log message ***

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Trygve Laugstol 2004-08-31 23:53:25 +00:00
parent 4d1ac08117
commit bd9e37321c
3 changed files with 56 additions and 14 deletions

View File

@ -23,7 +23,7 @@ public class Maven1Repository
public Iterator getArtifactsByType( String type )
throws Exception
{
List files = FileUtils.getFiles( getRepository(), "tambora*/" + type + "s/*." + type, "" );
List files = FileUtils.getFiles( getRepository(), "*/" + type + "s/*." + type, "" );
Collections.sort( files );

View File

@ -23,6 +23,7 @@ package org.apache.maven.converter;
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.OutputStreamWriter;
@ -55,6 +56,10 @@ import org.apache.maven.model.v300.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.FileUtils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
* @version $Id$
@ -182,7 +187,14 @@ public class PomV3ToV4Converter
// Group id
String groupId = v3Model.getGroupId();
if( isEmpty( groupId ) && isEmpty( v3ParentModel.getGroupId() ) )
String parentGroupId = null;
if ( v3ParentModel != null )
{
parentGroupId = v3ParentModel.getGroupId();
}
if( isEmpty( groupId ) && isEmpty( parentGroupId ) )
{
throw new Exception( "Missing 'groupId' from both pom and the extended pom." );
}
@ -194,15 +206,18 @@ public class PomV3ToV4Converter
if ( isEmpty( artifactId ) )
{
throw new Exception( "Missing element 'artifactId'." );
// throw new Exception( "Missing element 'artifactId'." );
v4Model.setArtifactId( groupId );
}
else
{
v4Model.setArtifactId( artifactId );
}
// Version
String version = v3Model.getCurrentVersion();
if( isEmpty( version ) && isEmpty( v3ParentModel.getCurrentVersion() ) )
if( isEmpty( version ) && (v3ParentModel == null || isEmpty( v3ParentModel.getCurrentVersion() ) ) )
{
throw new Exception( "Missing 'currentVersion' from both pom and the extended pom." );
}
@ -301,7 +316,7 @@ public class PomV3ToV4Converter
if ( !extendFile.isFile() )
{
throw new Exception( "Could not find the file the pom extends: '" + extendFile.getAbsolutePath() + "' is not a file." );
throw new FileNotFoundException( "Could not find the file the pom extends: '" + extendFile.getAbsolutePath() + "' is not a file." );
}
// try to find the parent pom.
@ -797,8 +812,21 @@ public class PomV3ToV4Converter
model = v3Reader.read( new FileReader( inputFile ) );
/*
String id = model.getId();
SAXReader r = new SAXReader();
Document d = r.read( new FileReader( inputFile ) );
Element root = d.getRootElement();
Element idElement = root.element( "id" );
String id = null;
if ( idElement != null )
{
id = idElement.getText();
}
// String id = model.getId();
String groupId = model.getGroupId();
@ -843,7 +871,7 @@ public class PomV3ToV4Converter
model.setArtifactId( artifactId );
}
}
*/
/**/
return model;
}

View File

@ -17,12 +17,15 @@ package org.apache.maven.converter;
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Iterator;
import org.apache.maven.model.Model;
import org.codehaus.plexus.embed.ArtifactEnabledEmbedder;
import org.xmlpull.v1.XmlPullParserException;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l </a>
* @version $Id$
@ -110,6 +113,14 @@ public class RepoReaper
{
warning( "Could not parse: '" + pomPath + "'.");
if ( ex instanceof XmlPullParserException ||
ex instanceof FileNotFoundException )
{
warning( " " + ex.getMessage() );
}
else
{
/*
Throwable t = ex;
while ( t != null )
@ -118,6 +129,9 @@ public class RepoReaper
t = t.getCause();
}
*/
ex.printStackTrace( System.err );
}
continue;
}