【问题标题】:Maven(-exec-plugin) parses the * (asterisk) symbolMaven(-exec-plugin) 解析 *(星号)符号
【发布时间】:2019-08-01 01:15:48
【问题描述】:

我想使用exec-maven-plugin 来执行一些基于 NPM 的任务。

我有一个问题,我的参数没有正确传递,所以我尝试使用一个批处理文件,它输出传递的参数,作为调试。

我得出的结论是,包含* (asterisk) 符号的参数被完全忽略了。如果我尝试使用符号本身,我会得到工作目录中作为单独参数传递的文件列表。

我怎样才能告诉 maven(-exec-plugin) 只传递带有 * 符号不变的参数?

这里的上下文似乎并不重要,但我不会冒险。这是我的配置:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>E:\test.bat</executable>
                    <arguments>
                        <argument>src\main\java\&#42;&#42;\&#42;.css</argument>
                        <argument>--use autoprefixer</argument>
                        <argument>-d target</argument>
                        <argument>--base src\main\java</argument>
                    </arguments>
                    <workingDirectory>${basedir}</workingDirectory>
                </configuration>
            </plugin>

PS.:用&amp;#42; 替换* 不起作用

【问题讨论】:

    标签: maven special-characters exec-maven-plugin


    【解决方案1】:

    使用commandlineArgs 而不是arguments 解决了这个问题。原因我不知道

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-29
      • 2011-09-25
      • 2013-08-04
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多