Solution: add the following pluginmanagement before plugins. The order of the two is as follows:
<Build> <pluginmanagement> <plugins> <plugin> <groupid> Org. eclipse. m2e </groupid> <artifactid> lifecycle-mapping </artifactid> <version> 1.0.0 </version> <configuration> <strong> <pluginexecutions> <pluginexecution> <pluginexecutionfilter> <groupid> Org. apache. maven. plugins </groupid> <artifactid> Maven-dependency-plugin </artifactid> <versionrange> [2.0 ,) </versionrange> <goals> <goal> copy-dependencies </goal> </goals> </pluginexecutionfilter> <action> <ignore/> </Action> </pluginexecution> </pluginexecutions> </lifecyclemappingmetadata> </configuration> </plugin> </plugins> </pluginmanagement> <plugins> <plugin> <groupid> Org. apache. maven. plugins </groupid> <artifactid> Maven-dependency-plugin </artifactid> <executions> <execution> <ID> copy-dependencies </ID> <phase> package </phase> <goals> <goal> copy-dependencies </goal> </goals> <configuration> <outputdirectory >$ {project. build. directory}/lib </outputdirectory> <excludetransitive> false </excludetransitive> <stripversion> true </stripversion> </configuration> </execution> </executions> </plugin> </plugins> </build>
Maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e