我需要使用Windows格式作为maven上exec的参数传递一个目录,这里是pom.xml的摘录
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>export</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<escape>true</escape>
<executable>${cmdl.exec}</executable>
<workingDirectory>${cmdl.location}</workingDirectory>
<arguments>
<argument>${project.basedir}\\target\\classes\\publishRoute</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是$ {project.basedir}解决单斜杠:
cmd /c script_cmdline.bat C:\Talend_CI\talend\release\Routes\SimpleRoute\\target\\classes\\publishRoute
Run Code Online (Sandbox Code Playgroud)
我需要用双反斜杠传递它.如何使用$ {project.basedir}实现此目的?
在查看与此问题相关的几篇文章后,似乎解决此问题的唯一有效方法是使用属性列表并相应地使用它们来实施分析。尽管这不是一个优雅的解决方法,但您可以选择动态分配文件路径,而不管用于运行 Maven 的操作系统/平台如何。
归档时间: |
|
查看次数: |
1981 次 |
最近记录: |