I’ve this multi module spring-boot project
-- module_1
-- pom.xml
-- module_2
-- pom.xml
-- pom.xml
module 2 has a dependency on module 1
with mvn package
the jar file is created into module_2/target
and contains this structure:
org/
module-info.class
META-INF/
BOOT-INF/
I want to create the jar file in parent/target
and not in module_2/target
I tried with assembly plugin in module_2 pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>../target</outputDirectory>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
and the jar file is correctly created in parent’s target but contains all folders and not the spring-boot structure