【问题标题】:Maven Replacer Plugin 1.5.3 No input file/s defined warningMaven Replacer Plugin 1.5.3 No input file/s defined 警告
【发布时间】:2023-04-05 15:46:01
【问题描述】:

我正在使用 maven 替换插件版本 1.5.3 从 tokenValueMap 创建输出文件作为我的替换模式文件。我的输入文件是一个 .txt 文件。这是我的 pom.xml 的样子。在运行 mvn groupId:artifactId:replace 时,它​​构建成功但收到警告“未定义输入文件”。替换在 0 个文件上运行。请建议!谢谢

 <plugin>
            <groupId>com.google.code.maven-replacer-plugin</groupId>
            <artifactId>replacer</artifactId>
            <version>1.5.3</version>
            <executions>
                <execution>
                    <id>osb-ext-pci-config</id>
                    <phase>generate-sources</phase> 
                    <goals>
                        <goal>replace</goal>
                    </goals> 
                     <configuration>
                        <file>src/main/customization/LocalImpl.txt</file>
                        <outputFile>target/local_out.xml</outputFile>
                    <tokenValueMap>src/main/customization/ReplacementPatterns.txt</tokenValueMap>
                </configuration>
             </execution>
            </executions>
     </plugin>

【问题讨论】:

  • 如果我读到 "注意:basedir 不再有默认值,如果不使用 basedir,这必须是绝对路径。" 中的 includes:include 参数Usage Guide 我想知道这是否也适用于 file 参数。他们只是忘了在那里或在更显眼的地方提及它。
  • @GeroldBroser 也试过了。但仍然给我同样的信息。

标签: java maven replace pom.xml maven-replacer-plugin


【解决方案1】:

请尝试使用 File 标签来提及输入文件。

例如:&lt;file&gt;${scac.input.dir}/WSDLs/ProjectB.wsdl&lt;/file&gt;

请查找以下插件作为示例。

<plugin>
    <groupId>com.google.code.maven-replacer-plugin</groupId>
    <artifactId>replacer</artifactId>
    <version>1.5.3</version>
    <executions>
        <execution>
            <phase>prepare-package</phase>
            <goals>
                <goal>replace</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <file>${scac.input.dir}/WSDLs/ProjectB.wsdl</file>
        <replacements>
            <replacement>
                <token>%SERVER_NAME%</token>
                <value>${env.soa.lbhost}</value>
            </replacement>
        </replacements>
    </configuration>
</plugin>`

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-06
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-05
    • 2012-02-11
    相关资源
    最近更新 更多