|
Perhaps you can help me understand your comments. I have used the assembly plugin the past and have had some difficulty with its configuration. It does not seem to have all the functionality needed. Most significant is the batch/shell script generation, my understanding is that it does not do this. However the appassembler plugin does this nicely. The assembly plugin can make an executable jar however often times we want batch/shell script generation. How can I do this? Also it is fine to use either of these plugins but unless I can copy(deploy) the resulting file(s) I cannot automate the build process, the files just remain in some obscure build target location. How can I copy the resulting file(s) to a release server? Is there a plugin to do this? Sorry, I should have been a bit more explicit. Run the appassembler plugin first and include the target directory. Example config: <assembly>
<id>bin</id>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/etc</directory>
<outputDirectory>etc</outputDirectory>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/appassembler/bin</directory>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>target/appassembler/repo</directory>
<outputDirectory>repo</outputDirectory>
</fileSet>
</fileSets>
</assembly>
In my project I'm runing both the "directory-inline" and "attached" goals of the assembly plugin to make it both package the plugin and to have a complete binary under target/.. To include the tarball into the repository, use the build-helper plugin to attach a file to your build: http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html The appassembler plugin is lacking documentation, I know. This should all be on the site descibed and in an example project somewhere. Can you show how in your pom you runing both the "directory-inline" and "attached" goals of the assembly plugin? Also how do you run the appassembler plugin first? I need both the appassembler and then the assembly plugins to be run after every release goal, where the release goal is run by our automated build server. Therefore I want release:prepare release:perform to fire all this off. Also I see the build-helper plugin can be used to add files for repo deployment. However since this is the final application package I don't see any value in putting this in a maven repo. Rather I want to but this in a network file share which is easy for users to get to and download from. Is there a plugin to help with this? Now as I am thinking about this...if it is possible to place this final application package on the site generated by maven then this would be good also. Basically I am looking for a way to publish this final application package in a location easily assessable by humans rather than by maven. Bind the appassembler to generate-resources and bind the assembler to something before package. Put those two plugins in a profile and make the release plugin include that profile when releasing. Make sure that the release plugin runs with the profile enabled, using something like the arugments configuration on the perform mojo (though I was sure there was a special configuration element to select which profiles to use). As for putting stuff on a network drive, I'd still point people to the Maven repository. But if you really have to use some antrun magic to copy stuff around. http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#arguments This example is a bit dated now, haven't touched the code in a while: <plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<programs>
<program>
<name>dpserver</name>
<mainClass>no.java.dp.server.cli.DpServerCli</mainClass>
</program>
<program>
<name>installer</name>
<mainClass>no.java.dp.server.installer.InstallerCli</mainClass>
</program>
</programs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<!--<phase>package</phase>-->
<goals>
<goal>directory-inline</goal>
<goal>attached</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/main/assembly/standalone.xml</descriptor>
</descriptors>
<tarLongFileMode>gnu</tarLongFileMode>
</configuration>
</plugin>
</plugins>
|
||||||||||||||||||||||||||||||||||||||
You really shouldn't use the appassembler that way. For one there is no uniform way to build the project and it won't work in a multi-project build.
The assembly plugin already has all the functionality you need to package and deliver zips and tarballs. I suggest you use that instead and put the tarball generation plugins in a "assembly" phase that is run on releases.