maven: how to packag many modules into a compressed distribution file - maven-3

I have a mavem pom project with a set of modules under it.
parent-pom
|---child-module-a
|---child-module-b
|---child-module-c
|---child-module-package
In the child-module-package, I want to create a compressed file consisting of files from other child modules.
the other module target jars
files from src/main/resources of other modules and put to "conf" directory in the final compressed jars.
include dependency jars of other child-modules in the "lib" directory.
create a manifest file.
Is there a plugin(s) that would allow me to do all the above?
Is the maven-assembly-plugin sufficient to do this?

Related

how to Include a folder and files in META-INF folder when creating the jar using ant task

I need a way to include a folders and files inside the META-INF directory when creating a jar using ant task.
Currrently I am using <metainf> tag , which is only including the files but not the folders.
Can anyone please help me.
Add new folder TEMP-INF under src\main\java
Put all the files and folders, which you wish to include in your JAR's META-INF into this newly created TEMP-INF
Now open build.xml file and search for
<jar> </jar> tag
Add <metainf dir="src/main/java/TEMP-INF"/> into <jar></jar>
And its done.

How to add properties file to classpath in Grails

What does it mean when it says to add a file to the classpath? Something like this:
// The configuration file we created. It must be in the classpath.
outEncryptionProps.put(WSHandlerConstants.ENC_PROP_FILE, "client_encryption.properties");
I use GGTS and I have other files other than properties file that I need to add to my project's classpath.
The classpath is a collection of jars and directories that are used to resolve classes and resources. In practice for files like this putting them in the classpath means that you should put it in a directory that's included in the classpath, or a directory whose contents are copied to a classpath folder during compilation.
In Grails you can put non-source files in grails-app/conf, src/java, or src/groovy and they'll be copied into the classpath.

Apache Ant Build, jar with external librarys

i have a Apache Ant build.xml to create a simple executeable jar file, but this file is very big.
Now i have the idea to build a executeable jar file with my code and have a directory named "lib" with all external jar files.
I think this will reduce the size of my application to 3%.
Thanks for your help.

Grails - How to include subdirectories of lib in classpath?

I have an application deployed and I need to include new jars during runtime.
I am currently doing it by placing the jars in the lib directory, but if I place them in some subdirectory of lib they are not loaded.
Is it possible to do it?

Separate same jars in different WAR of a EAR

currently we are facing one problem. We are building a ear which contains multiple war files. In 2 of the WARs contains same jars. Both these wars need these jars during deployment.So Is there any way in ANT I can built it so that these jars will be in one single place and it will not create any problem during the ear deployment.
well, you can do it the portable way:
Place the library jars at the root of .ear file.
Example:
library jar -> lib1.jar, lib2.jar
[EAR STRUCTURE]
your.ear
|--yourfirst.war
|--yoursecond.war
|--lib1.jar
|--lib2.jar
Update the MANIFEST.MF files in both the .war files to point to these jars
like so:
Class-Path: lib1.jar lib2.jar
(dont forget to add a space and a newline character to the end of the above line if this is the last entry in the manifest)
You can put those shared JARs into the EAR's lib directory. Those will then be available on the classpath for any WARs in that EAR.

Resources