jar中没有主清单属性

问题:maven项目打包后,启动时出现SpringBoot1.0-SNAPSHOT.jar中没有主清单属性的提示
解决方案:
1、在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.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.3.RELEASE</version>
                <configuration>
                    <mainClass>com.dubbo.provider.service.bootstrap.Consumer</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

2.IDEA点击Maven Projects中Lifecycle中install重新打包,再次运行java -jar SpringBoot1.0-SNAPSHOT.jar命令运行

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页