Every maven plugin has documentation on the maven site. It is the best
place to look for answers to questions like this. See:
http://maven.apache.org/plugins/maven-antrun-plugin/plugin-info.html
As the documentation says, writing a <target> tag is NOT allowed within
the pom.xml file.
So I would define this stuff in a separate build.xml file. The antrun
plugin can then be configured to execute a task in this separate file,
using the <ant> tag. And you can run the file directly from ant when you
want.
FYI, you can run the ant definition directly with
antrun:run
but you cannot specify a target as far as I can see. And that makes
sense, as the maven-antrun-plugin doesn't allow targets to be defined
within the pom.xml file.
Regards,
Simon
John Casey schrieb:
> You should be able to simply call the hibernatetool without a target.
> IIRC, the antrun plugin may not support targets.
>
> -john
>
> youhaodeyi wrote:
>> I use Maven runant plugin to execute ant task, see below:
>>
>> <build>
>> <plugins>
>> <plugin>
>> <artifactId>maven-antrun-plugin</artifactId>
>> <configuration>
>> <tasks>
>> <property name="output"
>> value="target/classes" />
>> <taskdef name="hibernatetool"
>> classname="org.hibernate.tool.ant.HibernateToolTask"
>> />
>>
>> <target name="schema-recreate">
>> <hibernatetool destdir="${output}">
>> <configuration
>> configurationfile="${output}/hibernate.cfg.xml" />
>> <hbm2ddl drop="true" create="true"
>> export="true" update="false" />
>> </hibernatetool>
>> </target>
>> </tasks>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> How can I run the target schema-recreate? I don't want o attach this
>> into
>> any Maven lifecycle.
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]