3
votes

I try to create a maven web project.

I follow this guide

The problem is that when I create the project, it has this error. Thi is my pom.xml

<?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>it.crud</groupId>
  <artifactId>CRUD</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>CRUD Maven Webapp</name>
  <!-- FIXME change it to the project's website -->
  <url>http://www.example.com</url>

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

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
    </dependency>
  </dependencies>


</project>

THIS IS the build error:

Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1]

Anyone can help me to resolve this?

1
Why is the compiler plugin a dependency? - Roddy of the Frozen Peas
@RoddyftheFrozen I don't know why but I have installed eclipse oxygen and when I create project for the first time I obtain these error. Also if I convert a dynamic web project in a maven project I obtain error. I don't know why, maybe is it better if delete and reinstall maven? - Polly
@Polly You were asked, why did you include maven-compiler-plugin as a dependency of your project. Your answer has almost nothing to do with the question. - lexicore
Please include the full mvn -X -e clean install log. - lexicore

1 Answers

1
votes

I assume you are using JDK 7...if so you have to check your JDK 7 options cause a month ago Maven Central does not support anymore TLS v1.X you have to configure your build by using:

mvn -Dhttps.protocols=TLSv1.2 <goals>

More details can be found on the documentation.

Apart from the above I recommend to try the build on plain command line and not inside Eclipse...