I do this all the time. I use assembly:single.
I run it from a project that has pretty much nothing else in it except the assembly run. For shared config files and such, I package them up as zip files, push them to nexus, and stage them with dependency:unpack. For jar file dependencies that can't be called out in the dependencySet, I use dependency:copy to stage them and then, again, pick them up as part of a fileSet. I've even managed to share the assembly descriptors by using the 'grab them from an artifact' business. On Thu, Dec 30, 2010 at 10:02 PM, Steve Cohen <[email protected]> wrote: > Now that was good, but the question is why can't something like that be > available through the assembly plugin itself? > > Build the main jar and its dependencies, install the non-third party jars > into the local repository, then pull them back out into an assembly staging > area, together with third party deps, along with any config files (all of > which is done easily by the appassembler plugin), then bundle the whole mess > into whatever kind of archive you choose. > > This could be a mode of the assembly plugin, but it isn't. Call it a > feature request. It would be worthwhile to combine these two > functionalities. > > On 12/30/2010 06:00 PM, Steve Cohen wrote: >> >> BINGO!!!!! >> >> Thanks so much, Dennis for pointing me in the RIGHT direction!! >> >> This is simple, just what I wanted. >> >> The last piece of the puzzle was the need to use the flat >> <repositoryLayout> >> >> Just what I wanted in under 2 hours, as opposed to two days fighting >> with the complexities of the assembler plugin! >> >> Happy New Year, to all who helped me here!! You're the best! >> >> >> Steve >> >> >> >> On 12/30/2010 05:41 PM, Dennis Lundberg wrote: >>> >>> On 2010-12-31 00:08, Steve Cohen wrote: >>>> >>>> I think this is going to work. >>>> >>>> I absolutely don't need any of the shellscript generation (it would be >>>> nice to be able to turn it off) but I can ignore that. The creation of >>>> the repository inside the target is slick, and I assume I can use that >>>> to suck all the jars into the assembly plugin. >>> >>> Yep, here's the assembly descriptor I use: >>> >>> <assembly >>> >>> xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" >>> >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> >>> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 >>> >>> http://maven.apache.org/xsd/assembly-1.1.0.xsd"> >>> <id>dist</id> >>> <formats> >>> <format>zip</format> >>> </formats> >>> <includeBaseDirectory>false</includeBaseDirectory> >>> <fileSets> >>> <fileSet> >>> <directory>target/appassembler</directory> >>> <outputDirectory></outputDirectory> >>> <excludes> >>> <exclude>lib/maven-metadata-appassembler.xml</exclude> >>> >>> <exclude>lib/${project.artifactId}-${project.version}-site.xml</exclude> >>> </excludes> >>> </fileSet> >>> </fileSets> >>> </assembly> >>> >>> >>> and the relevant parts of the POM: >>> >>> >>> <plugin> >>> <groupId>org.codehaus.mojo</groupId> >>> <artifactId>appassembler-maven-plugin</artifactId> >>> <version>1.0</version> >>> <configuration> >>> <programs> >>> <program> >>> <mainClass>my.class.name</mainClass> >>> <name>MyProgram</name> >>> </program> >>> </programs> >>> <repositoryLayout>flat</repositoryLayout> >>> <repositoryName>lib</repositoryName> >>> </configuration> >>> <executions> >>> <execution> >>> <goals> >>> <goal>assemble</goal> >>> </goals> >>> </execution> >>> </executions> >>> </plugin> >>> <!-- Must come after appassembler-maven-plugin --> >>> <plugin> >>> <groupId>org.apache.maven.plugins</groupId> >>> <artifactId>maven-assembly-plugin</artifactId> >>> <configuration> >>> <descriptors> >>> <descriptor>src/main/assembly/assembly.xml</descriptor> >>> </descriptors> >>> <tarLongFileMode>gnu</tarLongFileMode> >>> </configuration> >>> <executions> >>> <execution> >>> <id>make-assembly</id> >>> <phase>package</phase> >>> <goals> >>> <goal>single</goal> >>> </goals> >>> </execution> >>> </executions> >>> </plugin> >>> >>> >>> >>>> >>>> >>>> On 12/30/2010 04:23 PM, Steve Cohen wrote: >>>>> >>>>> Thanks again, Dennis. I've now read the documentation more carefully >>>>> and >>>>> this doesn't look as though it does any actual packaging into an >>>>> archive >>>>> (be it zip, jar, tar, etc.) It seems to be ALL about the launch script >>>>> and might have been the way to go before I developed all this by hand >>>>> with commons-daemon and NOT AT ALL about the actual packaging. >>>>> >>>>> Is the idea then to assemble everything in a directory and THEN pass >>>>> this as a fileSet to the assembly plugin? >>>>> >>>>> Or am I missing something? >>>>> >>>>> >>>>> On 12/30/2010 02:37 PM, Dennis Lundberg wrote: >>>>>> >>>>>> Hi Steve >>>>>> >>>>>> May I suggest that you have a look at the Appassembler Maven Plugin >>>>>> for >>>>>> your batch processing application. >>>>>> >>>>>> >>>>>> http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/usage-program.html >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On 2010-12-30 21:16, Steve Cohen wrote: >>>>>>> >>>>>>> After a very frustrating couple of days trying to understand the new >>>>> >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> 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] >>>> >>>> >>> >>> >> >> >> --------------------------------------------------------------------- >> 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
