You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Markus Karg <ka...@quipsy.de> on 2013/04/25 10:13:59 UTC

How to tell Maven to generate code when XSL has changed?

I am using xml-maven-plugin to generate Java code from XML:

 

       <groupId>org.codehaus.mojo</groupId>

       <artifactId>xml-maven-plugin</artifactId>

       <version>1.0</version>

       <executions>

             <execution>

                    <phase>generate-sources</phase>

                    <goals>

                           <goal>transform</goal>

                    </goals>

             </execution>

       </executions>

 

This works well, but now I want that it automatically executes as soon
as the used transformation XSLT file was modified. So how can I tell
maven that it shall do generate-sources as soon as a particular file was
touched?

 

Thanks!

-Markus


Re: How to tell Maven to generate code when XSL has changed?

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Kathryn

Kathryn Huxtable wrote:

> I'm not the requestor, but it seems like time stamp would be reasonable.
> But you also have a "forceCreate" config (or something like that, it's
> been a few weeks since I last typed it.) They could just use that and
> always generate the file.

Simply clean first to force generation.

> On Apr 25, 2013, at 5:20 AM, Baptiste MATHUS wrote:
> 
>> How would you like it to detect that file was changed?
>> If you can come up with a sensible way of doing that, please just file a
>> JIRA and we could look into it.
>> Even better, if you can provide a good patch I can take apply it.

Create a timestamp file? IIRC the dependency plugin and assembly plugin do 
it this way.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to tell Maven to generate code when XSL has changed?

Posted by Kathryn Huxtable <ka...@kathrynhuxtable.org>.
I'm not the requestor, but it seems like time stamp would be reasonable. But you also have a "forceCreate" config (or something like that, it's been a few weeks since I last typed it.) They could just use that and always generate the file.

-K
On Apr 25, 2013, at 5:20 AM, Baptiste MATHUS wrote:

> How would you like it to detect that file was changed?
> If you can come up with a sensible way of doing that, please just file a
> JIRA and we could look into it.
> Even better, if you can provide a good patch I can take apply it.
> 
> Cheers
> 
> 
> 2013/4/25 Markus Karg <ka...@quipsy.de>
> 
>> I am using xml-maven-plugin to generate Java code from XML:
>> 
>> 
>> 
>>       <groupId>org.codehaus.mojo</groupId>
>> 
>>       <artifactId>xml-maven-plugin</artifactId>
>> 
>>       <version>1.0</version>
>> 
>>       <executions>
>> 
>>             <execution>
>> 
>>                    <phase>generate-sources</phase>
>> 
>>                    <goals>
>> 
>>                           <goal>transform</goal>
>> 
>>                    </goals>
>> 
>>             </execution>
>> 
>>       </executions>
>> 
>> 
>> 
>> This works well, but now I want that it automatically executes as soon
>> as the used transformation XSLT file was modified. So how can I tell
>> maven that it shall do generate-sources as soon as a particular file was
>> touched?
>> 
>> 
>> 
>> Thanks!
>> 
>> -Markus
>> 
>> --
>> Baptiste <Batmat> MATHUS - http://batmat.net
>> Sauvez un arbre,
>> Mangez un castor ! nbsp;!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to tell Maven to generate code when XSL has changed?

Posted by Baptiste MATHUS <ml...@batmat.net>.
How would you like it to detect that file was changed?
If you can come up with a sensible way of doing that, please just file a
JIRA and we could look into it.
Even better, if you can provide a good patch I can take apply it.

Cheers


2013/4/25 Markus Karg <ka...@quipsy.de>

> I am using xml-maven-plugin to generate Java code from XML:
>
>
>
>        <groupId>org.codehaus.mojo</groupId>
>
>        <artifactId>xml-maven-plugin</artifactId>
>
>        <version>1.0</version>
>
>        <executions>
>
>              <execution>
>
>                     <phase>generate-sources</phase>
>
>                     <goals>
>
>                            <goal>transform</goal>
>
>                     </goals>
>
>              </execution>
>
>        </executions>
>
>
>
> This works well, but now I want that it automatically executes as soon
> as the used transformation XSLT file was modified. So how can I tell
> maven that it shall do generate-sources as soon as a particular file was
> touched?
>
>
>
> Thanks!
>
> -Markus
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;!

Re: How to tell Maven to generate code when XSL has changed?

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Markus,

Markus Karg wrote:

> I am using xml-maven-plugin to generate Java code from XML:
> 
>  
> 
>        <groupId>org.codehaus.mojo</groupId>
> 
>        <artifactId>xml-maven-plugin</artifactId>
> 
>        <version>1.0</version>
> 
>        <executions>
> 
>              <execution>
> 
>                     <phase>generate-sources</phase>
> 
>                     <goals>
> 
>                            <goal>transform</goal>
> 
>                     </goals>
> 
>              </execution>
> 
>        </executions>
> 
>  
> 
> This works well, but now I want that it automatically executes as soon
> as the used transformation XSLT file was modified. So how can I tell
> maven that it shall do generate-sources as soon as a particular file was
> touched?

This is the responsibility of the plugin.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to tell Maven to generate code when XSL has changed?

Posted by Leon Rosenberg <ro...@gmail.com>.

On 25.04.2013, at 10:13, "Markus Karg" <ka...@quipsy.de> wrote:

> I am using xml-maven-plugin to generate Java code from XML:
> 
> 
> 
>       <groupId>org.codehaus.mojo</groupId>
> 
>       <artifactId>xml-maven-plugin</artifactId>
> 
>       <version>1.0</version>
> 
>       <executions>
> 
>             <execution>
> 
>                    <phase>generate-sources</phase>
> 
>                    <goals>
> 
>                           <goal>transform</goal>
> 
>                    </goals>
> 
>             </execution>
> 
>       </executions>
> 
> 
> 
> This works well, but now I want that it automatically executes as soon
> as the used transformation XSLT file was modified. So how can I tell
> maven that it shall do generate-sources as soon as a particular file was
> touched?
> 
> 
mvn clean :-)
regards 
Leon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org