You should probably use the maven assembly plugin Jeff Le 2 avr. 2012 17:47, "Mariusz Plucinski" <[email protected]> a écrit :
> Hello Maven users, > > I am really newbie in Maven, so I am not pretty sure if my way of thinking > is right. If it's not, do not hesitate to criticize it. > > I am developing medium-size project, which contains both Java SE and > Android sub-projects. After many troubles with Ant, I've decided to give > Maven's a try. > > To make it simple, let's say that I have three projects: > - Android application > - Swing application > - Main application (also uses Swing, but this is not important now) > > Those three applications are building pretty well with maven. I am typing > "mvn package" and - as expected - I get one *.apk file and two *.jar files. > Thanks to maven-shade-plugin, JAR files contains all required dependencies. > They are, of course, executable jars. > > Goal of Main application is to "generate" Swing and Android applications > for user's request. Those applications are prebuilt, so Main program needs > only to slightly modify it before putting onto user's disk. However, I > would like to deliver only one file - Main.jar. Two other files - > Android.apk and Swing.jar should be put as entire files inside of Main.jar > (they should stay there as full files, without unpacking or anything). This > way, when user decided to generate e.g. Swing application, Main application > gets whole file Swing.jar from itself, modifies it a little and put > somewhere to user's file system. That same is possible in case of > generating Android program. But it requires shipping Android.apk and > Swing.jar inside of Main.jar. > > Is it possible to be done using Maven? I suppose that Swing.jar and > Android.apk should be provided as resources during build of Main.jar, but I > don't know how to instruct Maven to do it this way. I have tried to set > <phase>compile</phase> in maven-jar-plugin configuration in Swing.jar. I > suppose it is wrong solution - in compile phase, Main application should > already have all required resources. Is there any way to instruct Maven to > "package" my Android and Swing projects during "prepare-resources" of Main > project? Of course, those two are dependencies, so Main project should be > informed, that resources were changed in case of modifications in those two. > > I am using Maven 3.0.3 and m2e 1.0.200. > > Thank you in advance for any help/advise/criticism :). > > Best Regards, > Mariusz Pluciński > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
