我正在使用Maven 3.0.3和Google replacer插件。我想使用maven变量$ {project.build.dir}用绝对路径替换文件中的相对路径。我正在尝试这个......
<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]
我该如何纠正?谢谢, - 戴夫
答案 0 :(得分: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="${project.build.directory}/org"
file="target/org/mainco/subco/db/changelog/db.changelog-master.xml" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>