Hi,

I've been using the antrun plugin (1.3) to do some post processing on
my generated JPA models using the replaceregexp task, e.g.:

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>modify-hibernate-models</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
              <replaceregexp
file="${project.build.directory}/generated-sources/hibernate3/com/{redacted}persistence/model/BillingPolicy.java"
match="(.*name=&quot;period&quot;.*)" replace="\1
@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)"
byline="true" />
              <!-- snip -->
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>

This has worked fine for me all along. However, after upgrading to 1.5
I start getting sax parse errors:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.5:run
(modify-hibernate-models) on project das-common-persistence: An Ant
BuildException has occured: Element type "replaceregexp" must be
followed by either attribute specifications, ">" or "/>". -> [Help 1]

 It appears that the new strategy is to emit a temporary ant build.xml
file that is then run. The problem is that when this is done, the
quote entities in my regular expression above are expanded when this
file is written and the following is generated:

<project name="maven-antrun-" default="main"  >
<target name="main">
 <replaceregexp replace="\1
@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)"
byline="true" file="{redacted}/BillingPolicy.java"
match="(.*name="period".*)"/>
<!-- snip -->
</target>

</project>

This breaks the match attribute and fails my build.

Any ideas?

Thanks,

Charles

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to