0

我正在使用 Maven 3.0.3 和 Google 替换插件。我想使用 maven 变量 ${project.build.dir} 将文件中的相对路径替换为绝对路径。我正在尝试这个……</p>

        <plugin>
            <groupId>com.google.code.maven-replacer-plugin</groupId>
            <artifactId>replacer</artifactId>
            <version>1.5.1</version>
            <executions>
                <execution>
                    <id>adjust-liquibase-script</id>
                    <phase>process-test-resources</phase>
                    <configuration>
                        <file>target/mainco/subco/db/changelog/db.changelog-master.xml</file>
                        <outputFile>target/org/mainco/subco/db/changelog/db.changelog-master.xml</outputFile>
                        <replacements>
                            <replacement>
                                <token>include file="org</token>
                                <value>include file="${project.build.dir}/org</value>
                            </replacement>
                        </replacements>
                    </configuration>
                    <goals>
                        <goal>replace</goal>
                    </goals>
                </execution>

但得到错误

[ERROR] Failed to execute goal com.google.code.maven-replacer-plugin:replacer:1.5.1:replace (adjust-liquibase-script) on project sbadmin: Illegal group reference -> [Help 1]

我该如何纠正?谢谢, - 戴夫

4

1 回答 1

0

我切换到antun插件并让它工作

            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <id>format-liquibase-files</id>
                            <phase>process-test-resources</phase>
                            <configuration>
                                <tasks>
                                    <replace token='include file="org'
                                        value="include file=&quot;${project.build.directory}/org"
                                        file="target/org/mainco/subco/db/changelog/db.changelog-master.xml" />
                                </tasks>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
于 2013-03-19T00:59:52.173 回答