Actually I do use the Assembly Plugin to generate a -with-dependencies.jar.
But after that, I need to put the jar on the template directory, along with the installation files such as the license text file, the configuration files, the documentation, etc. Am I missing a feature for the Assembly plugin? Steven, Is using Ant scripts really acceptable from a Maven good-practice point of view? Thanks, Rodrigo On 7/13/07, EJ Ciramella <[EMAIL PROTECTED]> wrote:
Why not set up an assembly and use assembly:directory to do this? -----Original Message----- From: Steven Rowe [mailto:[EMAIL PROTECTED] Sent: Friday, July 13, 2007 11:01 AM To: Maven Users List Subject: Re: Installer Scripts Best Practice Hi Rogrigo, Rodrigo Madera wrote: > I was wondering if anyone has a suggestion on the best practice to > execute post-build scripts, such as copying output files to a > template directory for installer generation. > > Right now I'm using a shell script to do the copying and calling my > installer-generating scripts, but I'm sure there is another (and less > painful) way of doing this. I don't know about best practices, but you could automate these tasks with Maven 2 by binding plugin executions to the phase you use to build. For example, if you run the lifecycle through the "package" phase (i.e., "mvn package" is how you perform your build), you could bind an antrun plugin[1] execution for the copying[2], and exec plugin[3] execution(s) to invoke the installer generation script(s). Something like (caveat: untested): <build> ... <plugins> ... <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>copy-files-for-installer-generation</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <copy todir="${project.build.dir}/installer"> <fileset dir="${project.build.dir}"> <includes> <include>${artifactId}-${version}.jar</include> ... </includes> </fileset> </copy> ... </tasks> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>call-first-installer-generator-script</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable> /path/to/first/installer/generator/script </executable> <workingDirectory> ${project.build.directory}/installer </workingDirectory> <arguments> <argument>...</argument> ... </arguments> </configuration> </execution> <execution> <id>call-second-installer-generator-script</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable> /path/to/second/installer/generator/script </executable> ... </configuration> </execution> ... </executions> </plugin> ... </plugins> ... </build> Steve [1] http://maven.apache.org/plugins/maven-antrun-plugin/ [2] http://ant.apache.org/manual/CoreTasks/copy.html [3] http://mojo.codehaus.org/exec-maven-plugin/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
