Reputation: 501
I am trying to set up Maven on a new laptop but in testing everything is OK by running mvn clean test
I am getting an error as below:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project test: Compilation failure -> [Help 1]
I have looked through the other posts for this and made some changes to my .pom file as suggested but I am still stuck with the same error. Unsure what other useful info to provide so please let me know what other info would be useful to troubleshoot this. Below is my .pom file:
<?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>matt</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.7.0_79\bin\javac</executable>
</configuration>
</plugin>
</plugins>
</build>
And here is java -version:
C:\Users\admin\IdeaProjects\test>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode, sharing)
And here is mvn -version:
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00)
Maven home: C:\Automation\Maven\apache-maven-3.6.0\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: C:\Program Files (x86)\Java\jre1.8.0_121
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "windows"
Upvotes: 0
Views: 9042
Reputation: 1
Try deleting "google" folder from C:\Users\User.m2\repository\com\google and try to rebuild.This should help you.
Upvotes: 0
Reputation: 332
There is nothing wrong with you pom file. the error explicitly says Compilation Error. So probably you are missing something or there is a typo in your source code.
So try to add some more information or some code snippets to your question
Upvotes: 2