No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
报错翻译:这个Maven项目不知道要执行哪个命令。
解决方案:
- pom.xml文件 <build> 标签后面加上 <defaultGoal>compile</defaultGoal> 即可。
- 如图
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project dubbo-spring-boot-starter: Unable to execute gpg command: Error while executing process. Cannot run program "gpg.exe": CreateProcess error=2, 系统找不到指定的文件。 -> [Help 1]
报错翻译:使用的版本是maven3.X,其执行maven-ant-plugin的行为和maven2.x有一定的不同,需要引入pluginManagement。
解决方案:
<!--之前的内容--><build><plugins><plugin></plugin> ... <plugin></plugin></plugins></build><!--修改后的内容--><build><pluginManagement><plugins><plugin></plugin> ... <plugin></plugin></plugins></pluginManagement></build>