When I add import org.springframework.data.annotation.Id; to my Java file I get this error:
The import org.springframework.data cannot be resolved
My immediate thought is that I'm missing a dependency but I don't think this is the case.
Here's the dependencies from my build.gradle.
dependencies {
compile('org.springframework.boot:spring-boot-starter-webflux')
compile('org.synchronoss.cloud:nio-multipart-parser')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive')
compile('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('io.projectreactor:reactor-test')
}
Also, I've applied these plugins:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
Am I missing something, or how do I get past this issue?
Additional Info.
I ran ./gradlew clean build --refresh-dependencies --debug. Here is an extract from the log:
22:25:30.664 [ERROR] [system.err] /Users/me/git/learning-spring-boot/learning-spring-boot-ch2/src/main/java/com/greglturnquist/learningspringboot/learningspringboot/ImageService.java:40: error: constructor Image in class Image cannot be applied to given types;
22:25:30.664 [ERROR] [system.err] new Image(path.hashCode(),
22:25:30.664 [ERROR] [system.err] ^
22:25:30.664 [ERROR] [system.err] required: String
22:25:30.665 [ERROR] [system.err] found: int,String
22:25:30.665 [ERROR] [system.err] reason: actual and formal argument lists differ in length
22:25:30.698 [ERROR] [system.err] /Users/me/git/learning-spring-boot/learning-spring-boot-ch2/src/main/java/com/greglturnquist/learningspringboot/learningspringboot/ApiController.java:26: error: constructor Image in class Image cannot be applied to given types;
22:25:30.700 [ERROR] [system.err] new Image("1", "learning-spring-boot-cover.jpg"),
22:25:30.700 [ERROR] [system.err] ^
22:25:30.700 [ERROR] [system.err] required: String
22:25:30.700 [ERROR] [system.err] found: String,String
22:25:30.701 [ERROR] [system.err] reason: actual and formal argument lists differ in length
22:25:30.701 [ERROR] [system.err] /Users/me/git/learning-spring-boot/learning-spring-boot-ch2/src/main/java/com/greglturnquist/learningspringboot/learningspringboot/ApiController.java:27: error: constructor Image in class Image cannot be applied to given types;
22:25:30.701 [ERROR] [system.err] new Image("2", "learning-spring-boot-2nd-edition-cover.jpg"),
22:25:30.702 [ERROR] [system.err] ^
22:25:30.702 [ERROR] [system.err] required: String
22:25:30.702 [ERROR] [system.err] found: String,String
22:25:30.702 [ERROR] [system.err] reason: actual and formal argument lists differ in length
22:25:30.705 [ERROR] [system.err] /Users/me/git/learning-spring-boot/learning-spring-boot-ch2/src/main/java/com/greglturnquist/learningspringboot/learningspringboot/ApiController.java:28: error: constructor Image in class Image cannot be applied to given types;
22:25:30.706 [ERROR] [system.err] new Image("3", "bazinga.png")
22:25:30.706 [ERROR] [system.err] ^
22:25:30.706 [ERROR] [system.err] required: String
22:25:30.706 [ERROR] [system.err] found: String,String
22:25:30.707 [ERROR] [system.err] reason: actual and formal argument lists differ in length
22:25:30.713 [ERROR] [system.err] 4 errors
22:25:30.716 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute compile for :compileJava'
22:25:30.726 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute compile for :compileJava' completed
22:25:30.733 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Fingerprinting property destinationDir (Output) for task ':compileJava'
22:25:30.737 [LIFECYCLE] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache]
22:25:30.737 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileHashes.bin (/Users/me/git/learning-spring-boot/learning-spring-boot-ch2/.gradle/4.10.2/fileHashes/fileHashes.bin)
22:25:30.702 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
22:25:30.702 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :compileJava FAILED
22:25:30.738 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
22:25:30.739 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':compileJava'
22:25:30.740 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :compileJava'
22:25:30.740 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :compileJava' completed
22:25:30.741 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :compileJava (Thread[Task worker for ':',5,main]) completed. Took 59.344 secs.
22:25:30.741 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on :
22:25:30.742 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.13 completed (1 worker(s) in use)
22:25:30.743 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on root.1.13
22:25:30.743 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 7,5,main]] finished, busy: 0.0 secs, idle: 59.358 secs
22:25:30.744 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':',5,main]] finished, busy: 59.353 secs, idle: 0.006 secs
22:25:30.743 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 3,5,main]] finished, busy: 0.0 secs, idle: 59.358 secs
22:25:30.743 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':' Thread 2,5,main]] finished, busy: 0.0 secs, idle: 59.36 secs
22:25:30.748 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 59.365 secs
22:25:30.748 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
22:25:30.748 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed
22:25:30.749 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':compileJava'.
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Compilation failed; see the compiler error output for details.
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:25:30.750 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
22:25:30.751 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
22:25:30.751 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:25:30.751 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
22:25:30.751 [WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler]
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
22:25:30.751 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
22:25:30.751 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 47s
I checked ./gradlew dependencies org.springframework.boot:spring-boot-starter-data-mongodb-reactive -> 2.2.0.BUILD-SNAPSHOT contains org.springframework.data:spring-data-mongodb:2.1.4.BUILD-SNAPSHOT which contains org.springframework:spring-context:5.1.3.RELEASE -> 5.1.4.BUILD-SNAPSHOT. Is it possible org.springframework:spring-context:5.1.3.RELEASE -> 5.1.4.BUILD-SNAPSHOT is not a compatible version?
This class org.springframework.data.annotation.Id belongs to the Spring module org.springframework.data:spring-data-commons. So if you want to import classes from this module you should add a dependency to it:
dependencies{
compile("org.springframework.data:spring-data-commons")
// others ...
}
Note you should also be able to import this class without this explicit dependency to spring-data-commons module, since this module is already part of the transitive dependencies of your project (from spring-boot-starter-data-mongodb-reactive). This means that with your current build.gradle setup, you should be able to import this class without error.
./gradlew dependencies
+--- org.springframework.boot:spring-boot-starter-data-mongodb-reactive -> 2.0.0.RELEASE
| +--- org.springframework.boot:spring-boot-starter:2.0.0.RELEASE (*)
| +--- org.springframework.data:spring-data-mongodb:2.0.5.RELEASE
| | +--- org.springframework:spring-tx:5.0.4.RELEASE
| | | +--- org.springframework:spring-beans:5.0.4.RELEASE (*)
| | | \--- org.springframework:spring-core:5.0.4.RELEASE (*)
| | +--- org.springframework:spring-context:5.0.4.RELEASE (*)
| | +--- org.springframework:spring-beans:5.0.4.RELEASE (*)
| | +--- org.springframework:spring-core:5.0.4.RELEASE (*)
| | +--- org.springframework:spring-expression:5.0.4.RELEASE (*)
| | +--- org.springframework.data:spring-data-commons:2.0.5.RELEASE (*)
| | \--- org.slf4j:slf4j-api:1.7.25
So maybe you have a synch issue in your project, try to clean/close/reopen it.
Are you sure that data is part of the imported packages? It seems to me that you need to add org.springframework.data to your gradle file. You can see here that data is different package.
Related
I have encountered problems while trying to run sonarqube on my application. When I execute the command it throws me an error which doesn't say much to me. Does anyone know where is the problem here?
The Error looks like this:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.257 s
[INFO] Finished at: 2022-12-07T15:10:39+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project TeamTracker: Execution default-cli of goal org.sonarsource.sca
nner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.la
ng.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.9.1.2184
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/A113408609/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
[ERROR] urls[1] = file:/C:/Users/A113408609/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/C:/Users/A113408609/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/C:/Users/A113408609/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/C:/Users/A113408609/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
[ERROR] urls[5] = file:/C:/Users/A113408609/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security
.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module #26f204a4
[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
'cmd' is not recognized as an internal or external command,
operable program or batch file.
This is a command I execute:
mvn sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.projectName=$CI_PROJECT_PATH_SLUG
I have gone through documentations but I still really can't see what is the problem here :/
When I try to run mvn clean install the build is succesfull.
I am using Java 11, Maven 3.6.3 and Sonar Community Edition Version 8.9.10
my Software version
sonarqube 7.0
maven: 3.6.3
jdk: 17
sonar-maven-plugin: 3.8.0.2131
when I run
mvn --batch-mode clean verify
org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar
-Dsonar.host.url=http://***
-Dsonar.login=***
-Dsonar.password=***
-Dsonar.issuesReport.console.enable=true
-Dsonar.gitlab.commit_sha=30ddd2484f6a487bcbea96775d497e0bffa87653
-Dsonar.gitlab.ref_name=***
-Dsonar.gitlab.project_id=***
-Dsonar.analysis.mode=preview
-Dsonar.preview.excludePlugins=issueassign,scmstats
-Dmaven.test.skip=true
and I've set this parameter export SONAR_SCANNER_OPTS="--illegal-access=permit"
but it error as follows
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project train-mc: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/root/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.8.0.2131/sonar-maven-plugin-3.8.0.2131.jar
[ERROR] urls[1] = file:/root/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/root/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/root/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.0.226/sonar-scanner-api-2.16.0.226.jar
[ERROR] urls[5] = file:/root/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module #539a50ea
May need to upgrade sonarqube server's version
https://community.sonarsource.com/t/support-java-17-in-the-sonar-maven-plugin/51931
Problem
We are trying to consume a Maven components in a private Maven repository... The dependency right now is not being pulled for some reason... I have declared the dependency in gradle as follows:
dependencies {
implementation group: 'super_.platform.client', name: 'client-feign', version: '1.0.0-SNAPSHOT'
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/22268428/packages/maven"
}
}
When running gradle eclipse to pull the dependency, the command fails with the following:
[INFO] Resolving super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT with transitive dependencies
[WARNING] Missing POM for super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:07 min
[INFO] Finished at: 2020-11-06T19:49:27Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Missing:
[ERROR] ----------
[ERROR] 1) super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=super_.platform.client -DartifactId=client-feign -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR] 2) super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR]
[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/MojoExecutionException
Question
Since the Git repo at Gitlab is private, I would imagine the Maven repository is also private. How to download that in Gradle?
Solution
Add the token information in the Maven repo passing the value through Environment Variable: GITLAB_TOKEN. You need to use the credentials section with an HTTP Header object.
maven {
url "https://gitlab.com/api/v4/projects/22268428/packages/maven"
credentials(HttpHeaderCredentials) {
name "Private-Token"
value System.env.GITLAB_TOKEN
}
authentication {
header(HttpHeaderAuthentication)
}
}
After that, I was able to pull the library from the private Maven repository within the Gitlab repo.
GITLAB_TOKEN=1234556 gradle eclipse
I want to run some groovy scripts before gradle builds debug apk in Android.
task batchTask(type: JavaExec) {
description 'running tasks'
exec {
commandLine './Batch.groovy'
}
}
added this to build.gradle(app)
apply plugin: 'groovyx.grooid.groovy-android'
android{
...
dependsOn {
batchTask
}
}
dependencies {
...
compile 'org.codehaus.groovy:groovy:2.4.0:grooid'
}
added this to build.grade(android)
dependencies {
...
classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'
}
I keep getting the error Error:Cause: error=13, Permission denied
stack trace
15:24:22.688 [DEBUG] [org.gradle.process.internal.DefaultExecHandle]
Changing state to: STARTING 15:24:22.689 [DEBUG]
[org.gradle.process.internal.DefaultExecHandle] Waiting until process
started: command './Batch.groovy'. 15:24:22.693 [DEBUG]
[org.gradle.process.internal.DefaultExecHandle] Changing state to:
FAILED 15:24:22.693 [DEBUG]
[org.gradle.process.internal.DefaultExecHandle] Process 'command
'./Batch.groovy'' finished with exit value -1 (state: FAILED)
15:24:22.695 [DEBUG]
[org.gradle.configuration.project.BuildScriptProcessor] Timing:
Running the build script took 1.866 secs 15:24:22.798 [ERROR]
[org.gradle.BuildExceptionReporter] 15:24:22.799 [ERROR]
[org.gradle.BuildExceptionReporter] FAILURE: Build failed with an
exception. 15:24:22.799 [ERROR] [org.gradle.BuildExceptionReporter]
15:24:22.800 [ERROR] [org.gradle.BuildExceptionReporter] * What went
wrong: 15:24:22.800 [ERROR] [org.gradle.BuildExceptionReporter] A
problem occurred evaluating project ':app'. 15:24:22.800 [ERROR]
[org.gradle.BuildExceptionReporter] > A problem occurred starting
process 'command './Batch.groovy'' 15:24:22.801 [ERROR]
[org.gradle.BuildExceptionReporter] 15:24:22.801 [ERROR]
[org.gradle.BuildExceptionReporter] * Try: 15:24:22.801 [ERROR]
[org.gradle.BuildExceptionReporter] Run with --stacktrace option to
get the stack trace. 15:24:22.802 [LIFECYCLE]
[org.gradle.BuildResultLogger] 15:24:22.802 [LIFECYCLE]
[org.gradle.BuildResultLogger] BUILD FAILED
Update:
Running the task inside a Groovy shell did the trick.
task batchTask(type: JavaExec) {
description 'batchTask in progress'
new GroovyShell().run(file('Batch.groovy'))
}
Running the task inside a Groovy shell did the trick.
task batchTask(type: JavaExec) {
description 'batchTask in progress'
new GroovyShell().run(file('Batch.groovy'))
}
I know this is due to the fact that one or more jar files are corrupted in my ~/.m2/ repository but i cant actually figure out which jar file(s) has been corrupted or which jars, I am required to delete and re-download.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:2.3.2:compile (default-compile) on project CRUDWebAppMavenized: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
[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/hp/.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/hp/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] urls[2] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar
[ERROR] urls[3] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler- manager/1.8.1/plexus-compiler-manager-1.8.1.jar
[ERROR] urls[4] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]