maven - Maven 执行目标编译失败
问题描述
我正在mvn compile
从终端在 Solaris 服务器上编译一个简单的 maven 应用程序,我收到以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project maven-demo: Compilation failure -> [Help 1]
这是我的 pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MavenTest</groupId>
<artifactId>maven-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<fork>true</fork>
<source>1.8</source>
<target>1.8</target>
<executable>/usr/jdk/instances/jdk1.8.0</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
解决方案
你<executable>
的不是javac
。您需要指定完整路径,而不是目录。
推荐阅读
- c# - 由于文件路径问题,WINium 未打开驱动程序
- javascript - 当页面加载速度快于转换时间时,Barba.js 偶尔会跳过转换
- git - 将更改推送到 git 时,如何摆脱消息“注意!您推送到的分支 'master' 已重命名为 'main'”?
- python - 如何删除熊猫数据框中的重复行,以便只删除最后一个条目
- javascript - 动态和非动态地从同一个库中导入不同的组件?[下一个.JS]
- typescript - 将参数传递给超类时出现打字稿错误。`扩展参数必须具有元组类型或传递给休息参数 (TS2556)。`
- nearprotocol - NEAR localnet 上的大量重试和事务已过期
- jsf - 加载资源失败:服务器响应状态为 404 () font-awesome
- firebase - 需要一个 JavaScript 模块脚本,但服务器以“text/html”的 MIME 类型响应
- sql - SQL 查询按具有表 id 的列聚合字符串匹配