code_junkie

Insert a dependent jar into an installer jar

Nov 12th, 2011
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <plugin>
  2. <artifactId>maven-assembly-plugin</artifactId>
  3. <configuration>
  4. <archive>
  5. <manifest>
  6. <mainClass>com.example.installer.Installer</mainClass>
  7. </manifest>
  8. </archive>
  9. </configuration>
  10. </plugin>
  11.  
  12. <assembly>
  13. <id>installer</id>
  14.  
  15. <formats>
  16. <format>jar</format>
  17. </formats>
  18.  
  19. <baseDirectory></baseDirectory>
  20.  
  21. <dependencySets>
  22. <dependencySet>
  23. <outputDirectory>/</outputDirectory>
  24. <includes>
  25. <!-- this references your installer sub-project -->
  26. <include>com.example:installer</include>
  27. </includes>
  28. <!-- must be unpacked inside the installer jar so it can be executed -->
  29. <unpack>true</unpack>
  30. <scope>runtime</scope>
  31. </dependencySet>
  32. <dependencySet>
  33. <outputDirectory>/</outputDirectory>
  34. <includes>
  35. <!-- this references your server.war and any other dependencies -->
  36. <include>com.example:server</include>
  37. </includes>
  38. <unpack>false</unpack>
  39. <scope>runtime</scope>
  40. </dependencySet>
  41. </dependencySets>
  42. </assembly>
Add Comment
Please, Sign In to add comment