o Refined DirectoryScanner excludes

o Fixed some problems with version parsing from legacy repo searches.
o Added extension() method to artifact handlers used for conversions only
o Changed reports-directory layout to be less flat (faster to load on web browser, etc.)


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163750 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-04-04 03:43:11 +00:00
parent 11d160b52d
commit 0b06278758
8 changed files with 43 additions and 14 deletions

View File

@ -189,10 +189,12 @@ public class RepositoryCleaner
{
Artifact artifact = (Artifact) it.next();
String artifactReportPath = buildArtifactReportPath(artifact);
Reporter artifactReporter = null;
try
{
artifactReporter = new Reporter( reportsBase, artifact.getId().replace(':', '_') + ".report.txt" );
artifactReporter = new Reporter( reportsBase, artifactReportPath );
boolean errorOccurred = false;
@ -298,7 +300,7 @@ public class RepositoryCleaner
}
catch(Exception e)
{
artifactReporter.error("Error while rewriting file or POM for artifact: \'" + artifact.getId() + "\'", e);
artifactReporter.error("Error while rewriting file or POM for artifact: \'" + artifact.getId() + "\'. See report at: \'" + artifactReportPath + "\'.", e);
}
finally
{
@ -318,6 +320,13 @@ public class RepositoryCleaner
}
}
private String buildArtifactReportPath( Artifact artifact )
{
String classifier = artifact.getClassifier();
return artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId() + "/" + artifact.getType() + "/" + ((classifier != null)?(classifier + "-"):("")) + artifact.getVersion() + ".report.txt";
}
private void copyArtifact( Artifact artifact, File artifactTarget, Reporter reporter )
throws IOException
{

View File

@ -30,8 +30,8 @@ public class DtdHandler
return "dtds";
}
// public String packageGoal()
// {
// return "ejb:ejb";
// }
public String extension()
{
return "dtd";
}
}

View File

@ -30,8 +30,8 @@ public class EarHandler
return "ears";
}
public String packageGoal()
public String extension()
{
return "ear:ear";
return "ear";
}
}

View File

@ -30,8 +30,8 @@ public class RarHandler
return "rars";
}
public String packageGoal()
public String extension()
{
return "rar:rar";
return "rar";
}
}

View File

@ -29,5 +29,10 @@ public class SarHandler
{
return "sars";
}
public String extension()
{
return "sar";
}
}

View File

@ -30,8 +30,8 @@ public class TldHandler
return "tlds";
}
// public String packageGoal()
// {
// return "ejb:ejb";
// }
public String extension()
{
return "tld";
}
}

View File

@ -37,6 +37,9 @@ public interface ArtifactDiscoverer
"*/licenses/**",
"*/licences/**",
"**/.htaccess",
"**/*.html",
"**/*.asc",
"**/*.txt",
"**/REPOSITORY-V*.txt"
};

View File

@ -211,7 +211,19 @@ public class LegacyArtifactDiscoverer
}
String artifactId = artifactIdBuffer.toString();
int lastVersionCharIdx = versionBuffer.length() -1;
if(lastVersionCharIdx > -1 && versionBuffer.charAt(lastVersionCharIdx) == '-')
{
versionBuffer.setLength(lastVersionCharIdx);
}
String version = versionBuffer.toString();
if(version.length() < 1)
{
version = null;
}
getLogger().debug(
"Extracted artifact information from path:\n" + "groupId: \'" + groupId + "\'\n"