Hi!

I'd like to know what you think about the following problem:

One of my colleagues use the maven-antrun-plugin to execute an ant task which 
is not available through a native maven plugin (the openjpa-maven-plugin 
currently only implements the 'enhance' mojo, but no mappingtool support). He 
was able to link this to the process-classes phase, but now likes is to 
additionally invoke this step MANUALLY.

This is the antrun plugin config he used:

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
  <execution>
    <id>mappingtool</id>
    <!-- todo: make this a manual target -->
    <phase>process-classes</phase>
    <configuration>
      <tasks>
        <java classname="org.apache.openjpa.jdbc.meta.MappingTool"
              classpathref="maven.runtime.classpath"
              dir="target/classes" fork="true"
              args="-action buildSchema -foreignKeys false" />
      </tasks>
    </configuration>
    <goals>
      <goal>run</goal>
    </goals>
  </execution>
</executions>
</plugin>


While I personally would simply extend the openjpa-maven-plugin to also support 
the missing tasks (as I did with it's predecessor, the kodo-maven-plugin 
http://ns1.backwork.net/git/index.php?p=kodo-maven-plugin.git), this is not 
always an option for everyone (my colleague never wrote a mojo until now).

So, is there a way call something like:
$> mvn antrun:execute -Dantrun.id=mappingtool
or kind of?

If not (which I expect from looking at the source), do you also think that 
there is a need for something?

Plus: is it possible to implement this? All the defined ant tasks are usually 
bound to a special phase, so if we call the antrun plugin manually
$> mvn antrun:run
the maven-antrun-plugin gets no execution information at all, because it has no 
phase bound to it. Is there a way to get all task-defs even the ones from other 
phases, so we could iterate over them and grab the one with the right 'id'?

Hope my post isn't too confusing ;)

LieGrue,
strub

PS: I told him to extract his tasks to a seperate build.xml, so he could call 
it via ant. But to be honest, having the need to call ant natively doesn't 
really feel comfortable.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to