Hi,

I am trying to export the classpath in a file as a space-separated list
of jar by using the dependency:generate-resources plugin. Here is the
pluging configuration

  <plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
      <execution>
        <phase>generate-resources</phase>
        <goals>
          <goal>build-classpath</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <pathSeparator> </pathSeparator>
      <prefix>lib</prefix>
      <outputFilterFile>true</outputFilterFile>
      <outputFile>${project.build.directory}/cp.properties</outputFile>
    </configuration>
  </plugin>

This produces the following output: 

classpath=lib/logback-classic-0.9.21.jar:lib/commons-cli-1.1.jar:lib/slf4j-api-1.6.0.jar

and the pathSeparator is not taken into account. If I use something like
<pathSeparator>" "</pathSeparator> instead, I have somthing like

classpath=lib/logback-classic-0.9.21.jar" "lib/commons-cli-1.1.jar"
"lib/slf4j-api-1.6.0.jar

It looks like the spaces are stripped and the pathSeparator is empty,
leading the dependency:generate-resources plugin to use the system
default path separator.

How can I do to use space as a separator?

My goal is to generate a custom MANIFEST.MF file with a classpath
containing the maven classpath + the lib/classes/ firectory. For this I
generate a cp.properties file with the classpath, read it with the
read-project-properties goal of properties-maven-plugin, then use it in
the maven-jar-plugin to have a custom "Class-Path" entry in the manifest
file:
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
      <archive>
        <manifest>
          <mainClass>com.archipel.reef.Main</mainClass>
        </manifest>
        <manifestEntries>
          <Class-Path>${classpath}:lib/classes/</Class-Path>
        </manifestEntries>
      </archive>
    </configuration>
  </plugin>
But if I want the classpath to be correct, it must use a space as path
separator.

Thanks

Christophe Bliard



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to