maven打包普通java程序没有添加依赖问题
作者:互联网
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>com.lyf.dm.DaMa</mainClass> //这里是你的包含mian方法的类 </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
在pom.xml加入该配置解决
标签:xml,assembly,maven,lyf,plugins,java,打包 来源: https://www.cnblogs.com/a-small-lyf/p/12337610.html