<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>co.syntx.examples.rabbitmq.Main</mainClass> </manifest> </archive> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>
将上述xml添加到maven plugins节点下,<mainClass>子节点处修改你需要执行的main所在类(包含包名),重新编译打包即可。
时间: 2024-10-29 10:38:54