java无法安装路径无效_java – 编译无效标志 – 模块路径的致命错误

我有一个

project.最初它是一个单一模块项目,结构如下

java-cloud-sample\

src\

main\

java

pom.xml

我决定将它变成一个多模块结构 – 无论如何我使用java 9.

所以我把它分开了

java-cloud-sample\

java-cloud-rest-api\

src\

pom.xml

pom.xml

root pom.xml看起来像这样

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

com.lapots.breed.platform.cloud

java-cloud-sample

0.0.1-SNAPSHOT

pom

java-cloud-rest-api

org.springframework.boot

spring-boot-starter-parent

1.5.6.RELEASE

UTF-8

UTF-8

1.9

1.9

org.apache.maven.plugins

maven-compiler-plugin

3.6.2

org.apache.maven.plugins

maven-jar-plugin

3.0.0

org.apache.maven.plugins

maven-dependency-plugin

3.0.1

copy-dependencies

package

copy-dependencies

模块pom.xml看起来像这样

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

com.lapots.breed.platform.cloud

java-cloud-sample

0.0.1-SNAPSHOT

java-cloud-rest-api

Demo project for Spring Boot

jar

org.springframework.boot

spring-boot-starter-actuator

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-data-jpa

org.springframework.boot

spring-boot-devtools

runtime

com.h2database

h2

runtime

org.postgresql

postgresql

runtime

org.springframework.boot

spring-boot-starter-test

test

org.springframework.boot

spring-boot-maven-plugin

build-info

${project.build.sourceEncoding}

${project.reporting.outputEncoding}

${maven.compiler.source}

${maven.compiler.target}

但是当我尝试运行mvn clean package时,我得到了

INFO] java-cloud-rest-api ................................ FAILURE [ 1.060 s]

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

[INFO] BUILD FAILURE

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

[INFO] Total time: 2.104 s

[INFO] Finished at: 2017-09-08T17:15:46+03:00

[INFO] Final Memory: 27M/331M

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

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project java-cloud-rest-api: Fatal error compiling: invalid flag: --module-path -> [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/MojoExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR] mvn -rf :java-cloud-rest-api

问题是什么? (也许我应该将maven项目拆分为单独的模块,并将每个maven模块拆分为java模块)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值