亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

mvn compile 沒通過

<?xml version="1.0" encoding="UTF-8"?>


<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/maven-v4_0_0.xsd">

? ? <modelVersion>4.0.0</modelVersion>

<groupId>com.imooc.maven01</groupId>

<artifactId>maven01-model</artifactId>

<version>0.0.1-SNAPSHOT</version>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>4.10</version>

</dependency>

</dependencies>

</project>

package com.imooc.maven01.model;


public class HelloWorld{

public String sayHello(){

return "HelloWorld";

}



}

package com.imooc.maven01.model;

import org.junit.*/;

import org.junit.Assert.*;




public class HelloWorldTest{

@Test

public void testHello(){

Assert.assertEquals("Hello World!",new HelloWorld.sayHello());

}

}

結果:


F:\java tool\code\maven01>mvn compile

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------< com.imooc.maven01:maven01-model >-------------------

[INFO] Building maven01-model 0.0.1-SNAPSHOT

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

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven01-model ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] skip non existing resourceDirectory F:\java tool\code\maven01\src\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven01-model ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

[INFO] Compiling 1 source file to F:\java tool\code\maven01\target\classes

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

[ERROR] COMPILATION ERROR :

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

[ERROR] 不再支持源選項 5。請使用 6 或更高版本。

[ERROR] 不再支持目標選項 1.5。請使用 1.6 或更高版本。

[INFO] 2 errors

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

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

[INFO] BUILD FAILURE

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

[INFO] Total time:? 2.545 s

[INFO] Finished at: 2019-08-14T12:41:32+08:00

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

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project maven01-model: Compilation failure: Compilation failure:

[ERROR] 不再支持源選項 5。請使用 6 或更高版本。

[ERROR] 不再支持目標選項 1.5。請使用 1.6 或更高版本。

[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/MojoFailureException

F:\java tool\code\maven01>



正在回答

2 回答

你好問一下你這個問題怎么解決的呀? 我也遇到了同樣的問題

0 回復 有任何疑惑可以回復我~

是不是需要將maven項目中的jre改到1.7之類的

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
項目管理利器——maven
  • 參與學習       173031    人
  • 解答問題       789    個

使用maven來構建和管理Java項目,從環境配置,到maven核心知識

進入課程

mvn compile 沒通過

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號