1
resposta

Erro no arquivo pom.xml

Estou com esse erro no pom.xml na primeira linha do arquivo.

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>br.com.marcelo.jpa</groupId>
  <artifactId>projeto-jpa</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</project>

CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be 
     resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.0.9, org.apache.maven:maven-artifact:jar:2.0.9, org.codehaus.plexus:plexus-utils:jar:1.5.1, org.apache.maven:maven-core:jar:2.0.9, org.apache.maven:maven-
     settings:jar:2.0.9, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9, org.apache.maven:maven-profile:jar:2.0.9, org.apache.maven:maven-model:jar:2.0.9, org.apache.maven:maven-repository-metadata:jar:2.0.9, org.apache.maven:maven-
     error-diagnostics:jar:2.0.9, org.apache.maven:maven-project:jar:2.0.9, org.apache.maven:maven-plugin-registry:jar:2.0.9, org.apache.maven:maven-plugin-descriptor:jar:2.0.9, org.apache.maven:maven-artifact-manager:jar:2.0.9, org.apache.maven:maven-
     monitor:jar:2.0.9, org.apache.maven:maven-toolchain:jar:1.0, org.apache.maven.shared:maven-shared-utils:jar:0.1, com.google.code.findbugs:jsr305:jar:2.0.1, org.apache.maven.shared:maven-shared-incremental:jar:1.1, org.codehaus.plexus:plexus-
     component-annotations:jar:1.5.5, org.codehaus.plexus:plexus-compiler-api:jar:2.2, org.codehaus.plexus:plexus-compiler-manager:jar:2.2, org.codehaus.plexus:plexus-compiler-javac:jar:2.2, org.codehaus.plexus:plexus-container-default:jar:1.5.5, 
     org.codehaus.plexus:plexus-classworlds:jar:2.2.2, org.apache.xbean:xbean-reflect:jar:3.4, log4j:log4j:jar:1.2.12, commons-logging:commons-logging-api:jar:1.1, com.google.collections:google-collections:jar:1.0, junit:junit:jar:3.8.2: Failure to transfer 
     org.apache.maven:maven-plugin-api:jar:2.0.9 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not 
     transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.9 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
    - CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: 
     Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.codehaus.plexus:plexus-container-default:jar:1.5.5 -> junit:junit:jar:3.8.2: ArtifactDescriptorException: Failed to read artifact descriptor for junit:junit:jar:3.8.2: 
     ArtifactResolutionException: Failure to transfer junit:junit:pom:3.8.2 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. 
     Original error: Could not transfer artifact junit:junit:pom:3.8.2 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.
1 resposta

Olá Marcelo, tudo bem com você?

Você tentou criar um projeto em branco com o maven?, pelas dependências que ele está dando erro: maven-compiler, junit parece que você acabou criando baseado em algum arquetipo

Eu tentaria criar novamente o projeto dessa vez de fato criando um em branco, mas nesse exemplo acredito que apenas declarar no pom.xml as seguintes configurações resolvam o problema:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

Abraços e Bons Estudos :)