mvn打包及报错分析

普通打包命令:
  mvn clean install -Dmaven.test.skip=true
指定配置文件打包:
  mvn clean package -P prod -Dmaven.test.skip=true

      <profiles>
		...
		<profile>
	        <id>prod</id>
	        <properties>
	           <autoconfig.properties>prod.properties</autoconfig.properties>
	        </properties>
	    </profile>
	</profiles>    


使用idea中的命令窗口打包出现下面错误:
  error:
    No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
原因分析:
  1.查看idea的jdk的环境都是直接配置的jdk,未发现问题原因
  2.在git的cmd中使用命令进行编译还是不行,和idea环境无关
  3.查看javac编译命令是否可以执行,找不到命令,重新配置了jdk环境
  总结:之前jdk安装,自动添加jdk路径添加path环境变量中,编译命令的地址并没有自动配置到环境变量中

猜你喜欢

转载自www.cnblogs.com/2014-1130/p/9135136.html