springboot的package打包jar失败, 如何运行jar包

springboot的package打包jar失败, 如何运行jar包,第1张

springboot的package打包jar失败, 如何运行jar包

springboot在idea里面package打包成jar失败?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project gogo: Input length = 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

解决方法:

添加Maven的打包插件;


	
		
			org.apache.maven.plugins
			maven-resources-plugin
			3.1.0
		
		
			org.springframework.boot
			spring-boot-maven-plugin
		
	

然后先clean再package打包即可;

结果:

运行jar包:

在jar包的文件夹里,按住shift键,然后鼠标右击,“在此处打开Powershell窗口”;

在Powershell窗口输入:

java -jar xxx.jar

jar包名字太长的话,可以输入前几个字母,然后按tab键补齐;

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5575504.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存