When I use Maven to package the Spring Boot project, I do not want all dependencies to be packaged into the final JAR package. I want to start the JAR with -djava.ext.dirs referencing all dependent packages. How to write Maven pom.xml?
I use configuration:
<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>
                <overWriteReleases>false</overWriteReleases>
                <overWriteSnapshots>false</overWriteSnapshots>
                <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
        </execution>
    </executions>
</plugin>
It has a problem that it cannot find the main function when using java-jar main.jar
 
    