This is not what Maven allows you to do. From Maven's point of view, every JAR with a specific name should be exactly the same as every other JAR with the same name.
For example, let my project depend on abc-1.0.jar . I indicate this dependency because the ALphabet team published the abc library with the specified API for version 1.0. I should be able to get this jar file from any repository in the world, even from my street neighbor, when my Internet goes out and manually installs it in my local repository, and it should be exactly the same file. If it were not the same file, then I would not have a guarantee that the .class files inside the jar will contain the library code that I need to make my build successful without errors.
If you are truly motivated to do this job, it is theoretically possible. You can write a script that will:
- Parse the POM XML for the
properties section and parse the individual properties from there, as well as the names of the dependency jars - For each dependency ban with the "manifest_injected" classifier, try to find it in the local repository. If it does not exist, generate an empty Maven project with the given dependencies (without the
manifest_injected classifier), run mvn validate on it to make sure that the dependencies are loaded and placed in the local repository if they were found - Clone all specified JAR files, open clones, inject the manifest that you need with the properties you previously analyzed and save the entered jars to the right places in the Maven repository.
- Call the Maven assembly that was passed to the script as an argument.
Good luck
source share