mirror of https://github.com/apache/maven.git
[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:
parent
70055892fc
commit
2af9312363
|
@ -39,6 +39,11 @@ public class ManifestConfiguration
|
||||||
*/
|
*/
|
||||||
private String addExtensions;
|
private String addExtensions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This gets prefixed to all classpath entries.
|
||||||
|
*/
|
||||||
|
private String classpathPrefix = "";
|
||||||
|
|
||||||
public String getMainClass()
|
public String getMainClass()
|
||||||
{
|
{
|
||||||
return mainClass;
|
return mainClass;
|
||||||
|
@ -58,4 +63,16 @@ public class ManifestConfiguration
|
||||||
{
|
{
|
||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getClasspathPrefix()
|
||||||
|
{
|
||||||
|
String cpp = classpathPrefix.replaceAll( "\\\\", "/" );
|
||||||
|
|
||||||
|
if ( cpp.length() != 0 && !cpp.endsWith("/") )
|
||||||
|
{
|
||||||
|
cpp += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return cpp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ public class MavenArchiver
|
||||||
{
|
{
|
||||||
StringBuffer classpath = new StringBuffer();
|
StringBuffer classpath = new StringBuffer();
|
||||||
List artifacts = project.getRuntimeClasspathElements();
|
List artifacts = project.getRuntimeClasspathElements();
|
||||||
|
String classpathPrefix = config.getClasspathPrefix();
|
||||||
|
|
||||||
for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
|
for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
|
||||||
{
|
{
|
||||||
|
@ -84,6 +85,7 @@ public class MavenArchiver
|
||||||
classpath.append( " " );
|
classpath.append( " " );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
classpath.append( classpathPrefix );
|
||||||
classpath.append( f.getName() );
|
classpath.append( f.getName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue