[MNG-551]. Allow adding classpath prefix to manifest Classpath.

Thanks to Kenney Westerhof.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@209060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-07-04 11:59:42 +00:00
parent 70055892fc
commit 2af9312363
2 changed files with 19 additions and 0 deletions

View File

@ -39,6 +39,11 @@ public class ManifestConfiguration
*/
private String addExtensions;
/**
* This gets prefixed to all classpath entries.
*/
private String classpathPrefix = "";
public String getMainClass()
{
return mainClass;
@ -58,4 +63,16 @@ public class ManifestConfiguration
{
return packageName;
}
public String getClasspathPrefix()
{
String cpp = classpathPrefix.replaceAll( "\\\\", "/" );
if ( cpp.length() != 0 && !cpp.endsWith("/") )
{
cpp += "/";
}
return cpp;
}
}

View File

@ -73,6 +73,7 @@ public class MavenArchiver
{
StringBuffer classpath = new StringBuffer();
List artifacts = project.getRuntimeClasspathElements();
String classpathPrefix = config.getClasspathPrefix();
for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
{
@ -84,6 +85,7 @@ public class MavenArchiver
classpath.append( " " );
}
classpath.append( classpathPrefix );
classpath.append( f.getName() );
}
}