./mvnw clean install
当我第一次运行install命令时,它遇到以下问题。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.749s
[INFO] Finished at: Fri Jun 21 02:14:32 IST 2013
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-social-twitter4j: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile: org/codehaus/plexus/compiler/CompilerException**
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/SS%20Computer/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.jar
[ERROR] urls[1] = file:/C:/Users/SS%20Computer/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.compiler.CompilerException
[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/PluginContainerException
然后,我陷入另一个问题
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
我在OS X上。mvn -v
显示:
Maven home: /Users/matthuntington/Desktop/apache-maven-3.5.0
Java version: 9, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
这是我的pom文件
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.packtpub.restapp</groupId>
<artifactId>ticket-management</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ticket-management</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>1.5.7.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
您可以通过将以下属性添加到pom.xml文件中来指定Maven源/目标版本
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
我在上遇到以下错误: 下面是我的的代码: 我试图在code,但仍然得到相同的错误。
我看到了这个问题的许多答案,但它们对我不起作用。我在我的PC上安装了Visual Studio代码、最新版本的Java和Maven,并且我能够在PC上用Maven成功地构建我的应用程序。然后,我在我的Mac上经历了同样的步骤,我得到了这个错误。 Macos、Visual Studio代码、Maven和Java的新版本。就像所有其他人所说的,我将这些行添加到pom的属性部分。xml文件: 仍然得到相
我不知道为什么当我编码: 上面说 我已经使用了JDK1.7。当我在eclipse中打开它时,我没有得到那个错误。
我正在尝试构建一个使用lambda表达式的Kafka Streams应用程序。 我的maven构建配置是mvn clean install 我在结尾处添加了org.apache.maven.plugins:maven-compiler-plugin dependency。 我能做些什么来解决这个问题?
我在构建Cordova Android应用程序时收到了这个错误信息。 错误:(159,66)错误:source 1.7中不支持lambda表达式(使用source 8或更高版本启用lambda表达式) 在我的build.gradle(模块android)和build.gradle(模块CordovaLib)上设置了以下compileOptions,如下所示:
问题内容: 我正在使用maven 3.3.9在Jenkins上运行编译。我在某些代码上收到此错误,但不是全部: -source 1.6不支持multi-catch语句(使用-source 7或更高版本来启用multi-catch语句) 我正在使用Java 8进行编译: 执行Maven:-B -f /opt/jenkins/workspace/product/product-Content- Ope
我正在使用maven 3.3.9在Jenkins上运行编译。我在一些代码(但不是所有代码)上遇到此错误: -source 1.6中不支持multi-catch语句(使用-source 7或更高版本启用multi-catch语句) 我正在用Java 8编译: 执行Maven:-B-f/opt/jenkins/workspace/product/product-Content-Operations\u
当我使用JDK6在Eclipse Mars中调用ANT脚本时(运行为 出现问题:不支持低于1.7的JRE版本。 这仅仅是一个错误还是故意的?我在Eclipse上找不到相应的错误报告。所以Eclipse放弃了对ANT的Java6支持?! 截图:选择JDK 1.6作为ANT的运行时JRE