1.网上下载的开源的rocketmq,自己改了下pom文件,生成zip的压缩包,打包后运行,
这是zip解压后的图片

通过start.sh启动jar包,在windows下进行的操作
报错 提示Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication,
这是jar包解压后的截图

文件里面包含了启动类
2.这是我修改后的pom,主要改的是build标签下的内容
<build>
<resources>
<!--将resources下的配置文件拷贝到target/config目录下 -->
<resource>
<directory>src/main/resources</directory>
<targetPath>${project.build.directory}/config</targetPath>
</resource>
<!--编译的时候,类路径下也复制一份配置文件(防止开发启动的时候读取不到配置的情况) -->
<resource>
<directory>src/main/resources</directory>
<targetPath>${project.build.directory}/classes</targetPath>
</resource>
</resources>
<plugins>
<!-- 将所依赖的第三方jar包打入target下的lib目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- 解决资源文件的编码问题 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 打jar包的main方法配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.apache.rocketmq.console.App</mainClass>
</manifest>
</archive>
<!--打包的时候忽略classes 路径下的配置文件 -->
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>*.txt</exclude>
<exclude>static/**</exclude>
<exclude>templates/**</exclude>
</excludes>
</configuration>
</plugin>
<!-- 打zip包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerVersion>${maven.compiler.source}</compilerVersion>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.2.RELEASE</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
</plugin>
</plugins>
</build>
3.刚下载下来,编译成jar包没有任何问题,编译成zip包就有这个问题,这是我改成zip格式的target的文件截图,谁能给点思路,谢谢各位了。