Issue Details (XML | Word | Printable)

Key: MDEP-89
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Brian Fox
Reporter: Christophe Domas
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Dependency Plugin

change separators in build-classpath

Created: 03/May/07 09:09 AM   Updated: 15/Jan/08 11:31 AM   Resolved: 10/May/07 09:55 PM
Return to search
Component/s: build-classpath
Affects Version/s: 2.0
Fix Version/s: 2.0

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 2 hours, 30 minutes
Time Spent - 2 hours, 30 minutes

Environment: Windows / Unix


 Description  « Hide

Hi,
I'm trying to use the build-classpath to generate a unix-style classpath on a windows laptop (associated with the assembly plugin). I saw that you are using file.separator and path.separator to generate the classpath string but I'm affraid of side effect by overriding them in a properties file. Could you add a way to choose a style (windows|unix) or to override them in the plugin configuration?
thanks



Brian Fox added a comment - 03/May/07 09:45 AM

i think i'll just add a parameter to override the default so you can separate with any string needed.


Christophe Domas added a comment - 09/May/07 06:53 AM

2 parameters (file.separator and path.separator) will be fine for me.

Thanks a lot.


Brian Fox added a comment - 10/May/07 09:55 PM

snapshot deployed


David Biesack added a comment - 15/Jan/08 09:57 AM

Are the options named file.separator and path.separator or fileSeparator pathSeparator as documented at
http://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html which says

fileSeparator String Override the char used between the paths. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\'. The default is File.separator

pathSeparator String Override the char used between path folders. The system-dependent path-separator character. This field is initialized to contain the first character of the value of the system property path.separator. This character is used to separate filenames in a sequence of files given as a path list. On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'.

However, when I try those, they do not seem to work. On Windows, running maven 2.0.7,
I always get \ for the file separator char and : (not ; as documeted for Windows) for the path separator char.

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>build-classpath</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>
               <cpFile>${project.build.directory}/classpath.txt</cpFile>
               <regenerateFile>true</regenerateFile>
               <includeTypes>jar</includeTypes>
               <excludeClassifers>sources</excludeClassifers>
               <prefix>$M2_REPO</prefix>
               <pathSeparator>:</pathSeparator>
               <fileSeparator>/</fileSeparator>
            </configuration>
          </execution>
        </executions>
      </plugin>

I also tried

               <file.separator>/</file.separator>

with no change.


Brian Fox added a comment - 15/Jan/08 11:31 AM

Same comment as before, you need to get the snapshot plugin.