mirror of https://github.com/apache/maven.git
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:
parent
11d160b52d
commit
0b06278758
|
@ -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
|
||||
{
|
||||
|
|
|
@ -30,8 +30,8 @@ public class DtdHandler
|
|||
return "dtds";
|
||||
}
|
||||
|
||||
// public String packageGoal()
|
||||
// {
|
||||
// return "ejb:ejb";
|
||||
// }
|
||||
public String extension()
|
||||
{
|
||||
return "dtd";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ public class EarHandler
|
|||
return "ears";
|
||||
}
|
||||
|
||||
public String packageGoal()
|
||||
public String extension()
|
||||
{
|
||||
return "ear:ear";
|
||||
return "ear";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ public class RarHandler
|
|||
return "rars";
|
||||
}
|
||||
|
||||
public String packageGoal()
|
||||
public String extension()
|
||||
{
|
||||
return "rar:rar";
|
||||
return "rar";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,5 +29,10 @@ public class SarHandler
|
|||
{
|
||||
return "sars";
|
||||
}
|
||||
|
||||
public String extension()
|
||||
{
|
||||
return "sar";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ public class TldHandler
|
|||
return "tlds";
|
||||
}
|
||||
|
||||
// public String packageGoal()
|
||||
// {
|
||||
// return "ejb:ejb";
|
||||
// }
|
||||
public String extension()
|
||||
{
|
||||
return "tld";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,9 @@ public interface ArtifactDiscoverer
|
|||
"*/licenses/**",
|
||||
"*/licences/**",
|
||||
"**/.htaccess",
|
||||
"**/*.html",
|
||||
"**/*.asc",
|
||||
"**/*.txt",
|
||||
"**/REPOSITORY-V*.txt"
|
||||
};
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue