1

I need to create a "wrapper" project with a pom that pulls in a dependency jar file and adds some local config files to it (form src/main/resources) to create the target jar.

Can this be done using spring-boot-maven-plugin, maven-dependency-plugin, a combination of the two, or some other plugin entirely? (I have to use maven)

An example pom would be much appreciated.

Note: the dependency jar is built by a 3rd party as an executable jar (with transitive dependencies included) using spring-boot-maven-plugin. Likewise the jar I build must have the same main class and include all dependencies contained within the 3rd party jar.

Thanks in advance!

Stephen
  • 11
  • 2
  • Why do you want to build this wrapper jar? What should it change with respect to the "original" spring boot jar? – J Fabian Meier May 14 '21 at 06:32
  • To bundle our site-specific properties files with it. This will be a microservice that has to be deployed in the same way as our other microservices, with all dependencies and properties files bundled into a single executable jar for each service. – Stephen May 14 '21 at 06:43
  • First in general it's a bad idea to put configuration etc. within the resulting jar it should be provided from outside in microservice world. apart from that put them into `src/main/resources` as any other `application.propertes` etc. and they will being packaged into the resulting jar file... – khmarbaise May 14 '21 at 07:42
  • A slight correction to what I said above. *Some* configuration files will be bundled inside the jar. Others (containing environment specific settings) will be maintained externally. My question pertains to the former. I want to create a pom to take a 3rd party dependency jar and add some additional files to it from src/main/resources to create the target jar. Can this be easily done using maven? – Stephen May 14 '21 at 12:04

0 Answers0