I have a spring boot application where during maven installation I want to create a jar and copy the dependencies to the lib folder. I am trying to use these two maven plugins that work fine in other maven projects but don't work in the spring boot application.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <useDefaultManifestFile>true</useDefaultManifestFile> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>xxx.Main</mainClass> <classpathPrefix>lib/</classpathPrefix> </manifest> </archive> </configuration> </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> </configuration> </execution> </executions> </plugin>
What happens is that the jar is created even if the maven-jar-plugin is omitted. And it does nothing with the maven-dependency plugin. Therefore, it almost ignores both of these plugins.
source share