idea mvn 打包配置jar包和依赖包分离pom配置
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <configuration> <outputDirectory>../projectName/target/dependency/</outputDirectory> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <useUniqueVersions>false</useUniqueVersions> <classpathPrefix>dependency/</classpathPrefix> <mainClass>Main方法位置</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build>
dependency :copy-dependency =》将依赖jar包copy到
../projectName/target/dependency/
下