diff --git a/maven-archiver/src/main/java/org/apache/maven/archiver/ManifestConfiguration.java b/maven-archiver/src/main/java/org/apache/maven/archiver/ManifestConfiguration.java index ee0494bc1c..c0b350cd29 100644 --- a/maven-archiver/src/main/java/org/apache/maven/archiver/ManifestConfiguration.java +++ b/maven-archiver/src/main/java/org/apache/maven/archiver/ManifestConfiguration.java @@ -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; + } } diff --git a/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java b/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java index 11e8f1b44d..ad851e8a72 100644 --- a/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java +++ b/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java @@ -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() ); } }