Yes, you only need to do two things:

1.       Run the perl script

2.       Copy the files to the right location (if they can’t be generated 
directly to the location)

 

I have never used perl but according to google this plugin can help you execute 
perl scripts:
 <http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html> 
http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html



The resource plugin can then copy the resources with the copy-resources goal

 <http://maven.apache.org/plugins/maven-resources-plugin/> 
http://maven.apache.org/plugins/maven-resources-plugin/

 

You need to include both plugins in your pom and tie them to the pre-site 
phase. You can read more about lifecycle phases and how to tie plugins to them 
here:

 
<http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html>
 http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

 

When you have managed to do this, you will probably have a good basic 
understanding of how maven works and no need to call yourself a newbe =)

/Ludwig

 

From: Geoffrey Collis [mailto:[email protected]] 
Sent: den 5 februari 2011 22:27
To: [email protected]
Cc: [email protected]
Subject: Generating site content with Maven 2 site-plugin

 

I want to automatically generate  GIF files to be included in a web site 
generated using the maven-2 site plugin.

Part of the "site" contains an ASCII data file from which I need to 
[re]generate a number of GIF files using Perl and GNUPlot.
Site maintenance consists of updating the ASCII data file, regenerating the GIF 
files, adding some comments to APT files and pushing it live.

Is it possible to get the "mvn site:site" to run my Perl script which generates 
the GIF files and copies them to the site/resources/images directory so they 
get pushed to the site automatically?

Despite several days of reading through Doxia Macros, Mylyn, Wagon, Maven and 
ANT integration tips and various other plugins I am still clueless.

Can anyone provide any hints? I suspect I am missing something obvious, but I 
confess to being a relative newbie with respect to maven.

I am happy to rewrite the Perl script in Java if this makes it easier.

Regards

- Geoff



      

  _____  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3425 - Release Date: 02/05/11

Reply via email to