You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Boué (JIRA)" <ji...@apache.org> on 2016/10/14 17:33:21 UTC
[jira] [Commented] (MDEP-541) Allow for a space character as a
pathSeparator in dependency:build-classpath
[ https://issues.apache.org/jira/browse/MDEP-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15575952#comment-15575952 ]
Guillaume Boué commented on MDEP-541:
-------------------------------------
Can you explain what is your use-case? {{dependency:build-classpath}} is mainly used to generate the classpath so that it can be used as argument for {{java -cp}}. [{{pathSeparator}}|http://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html#pathSeparator] represents the system specific separator between paths.
The {{Class-Path}} entry inside the Manifest is normally generated by {{maven-archiver}}, that for example [the {{maven-jar-plugin}} uses|https://maven.apache.org/shared/maven-archiver/examples/classpath.html].
> Allow for a space character as a pathSeparator in dependency:build-classpath
> ----------------------------------------------------------------------------
>
> Key: MDEP-541
> URL: https://issues.apache.org/jira/browse/MDEP-541
> Project: Maven Dependency Plugin
> Issue Type: Improvement
> Components: build-classpath
> Reporter: Giedrius Noreikis
>
> Currently, the {{dependency:build-classpath}} goal does not allow a space character to be specified as a {{pathSeparator}}, which is necessary to generate {{Class-Path}} values for manifests.
> Because of a check {{isPathSepSet = StringUtils.isNotEmpty( pathSeparator )}} in {{BuildClasspathMojo.java}}, the parameter gets ignored in this case, and the classpath is built with a default separator.
> The possible workaround is to fix the path with {{build-helper:regex-property}}:
> {code:xml}
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>build-helper-maven-plugin</artifactId>
> <executions>
> <execution>
> <id>fix-classpath-for-manifest</id>
> <phase>prepare-package</phase>
> <goals><goal>regex-property</goal></goals>
> <configuration>
> <name>appClasspath</name>
> <value>${appClasspath}</value>
> <regex>;</regex>
> <replacement xml:space="preserve"> </replacement>
> <failIfNoMatch>false</failIfNoMatch>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
> but a fix would allow for a more straightforward solution.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)