springboot打jar包的问题:failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:complit

本文章纯属个人工作中遇到的问题,通过网上浏览其他文章以后自己组织语言编写。

问题:failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:complite

解决方法:1)pom.xml文件中在<project>节点以内添加

                        <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<configuration>
						<verbose>true</verbose>
						<fork>true</fork>
						<executable>${JAVA_HOME}/bin/javac</executable>
					</configuration>
				</configuration>
			</plugin>

2)F:/TOOL/Maven/apache-maven-3.2.5/conf/settings.xml(对应自己路径)中添加以下内容

<activeProfiles>
        <activeProfile>custom-compiler</activeProfile>
</activeProfiles>
  <profiles>
  	<profile>
          <id>custom-compiler</id>
          <properties>
            <JAVA_HOME>F:\TOOL\jdk170</JAVA8_HOME>
          </properties>
        </profile>
</profiles>
补充:jar包打好在cmd运行时,找到对应jar路径下的盘符,执行:java  -jar   xxxxx.jar  命令,如果出现错误提示: 没有主清单属性,需要在pom.xml文件中添加
                          <plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<maimClass>com.suzhen.App</maimClass>  //对应自己的App启动类
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值