初学Spring Boot,Maven install报错

何大书 发布于 2018/09/21 22:31
阅读 572
收藏 0

求助!项目使用spring boot APP正常运行,尝试着打包maven install爆出如下错误:

我在使用ssm(非Spring boot)能够正常install。也尝试过update project -> clean -> install的循环,后面给出创建该项目的过程和eclipse的配置

[INFO] Scanning for projects...

[INFO]

[INFO] -----------------< cn.gd.hel.study:spring-boot-study >------------------

[INFO] Building spring-boot-study 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ spring-boot-study ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO] Copying 2 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ spring-boot-study ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 9 source files to F:\stsWorkSpace\studyWork\spring-boot-study\target\classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[INFO] 1 error

[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.540 s

[INFO] Finished at: 2018-09-21T21:11:17+08:00

[INFO] ------------------------------------------------------------------------

[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-boot-study: Compilation failure

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[ERROR] -> [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/MojoFailureExcept

加载中
0
染墨若流云
染墨若流云

maven 的package插件没配置?

何大书
何大书
我只会用基本的maven操作,还不知道这个package插件呢,刚才网上找了一下好像也没有说这个的,是packge打包命令吗?这个我试过,也是提示编译插件的问题
0
染墨若流云
染墨若流云
<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.0.5.RELEASE</version>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
0
polly
polly

你看一下 javac -version

0
Last-xy
Last-xy

把这勾一下,要选jdk,不要选jre

0
何大书
何大书

不好意思哈,很久没上。发现并不是配置有问题,我通过命令行mvn install是可以正常打包,而使用STS就会报错,我也不明白什么情况。。

返回顶部
顶部