Books-Management-System icon indicating copy to clipboard operation
Books-Management-System copied to clipboard

mvn 问题

Open iroywang opened this issue 7 years ago • 1 comments

[INFO] Scanning for projects... [INFO] [INFO] ---------------------------< com.book:book >---------------------------- [INFO] Building book 1.0-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ book --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ book --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ book --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 21 source files to /Users/iroy/Desktop/Books-Management-System/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: 1.359 s [INFO] Finished at: 2018-06-07T09:53:49+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project book: 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 iroydeMBP:Books-Management-System iroy$ mvn --version Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00) Maven home: /usr/local/Cellar/maven/3.5.3/libexec Java version: 10, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home Default locale: zh_CN_#Hans, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac" iroydeMBP:Books-Management-System iroy$ mvn clean compile [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Malformed POM /Users/iroy/Desktop/Books-Management-System/pom.xml: Unrecognised tag: 'properties' (position: START_TAG seen ...\n ... @94:21) @ /Users/iroy/Desktop/Books-Management-System/pom.xml, line 94, column 21 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR]
[ERROR] The project com.book:book:1.0-SNAPSHOT (/Users/iroy/Desktop/Books-Management-System/pom.xml) has 1 error [ERROR] Malformed POM /Users/iroy/Desktop/Books-Management-System/pom.xml: Unrecognised tag: 'properties' (position: START_TAG seen ...\n ... @94:21) @ /Users/iroy/Desktop/Books-Management-System/pom.xml, line 94, column 21 -> [Help 2] [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/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

iroywang avatar Jun 07 '18 02:06 iroywang

pom.xml文件中增加jdk的设置,类似如下

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

withstars avatar Jun 13 '18 08:06 withstars