3

When I use maven install or clean for my spring project following error occurred.

this problem was occurred in Eclipse 2018-09 version. when I use eclipse photon version, did not occur this problem.

The error message.

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------------<  >-----------------------------
[INFO] Building  1.0.0-BUILD-SNAPSHOT
[INFO] --------------------------------    [  war ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.442 s
[INFO] Finished at: 2018-12-02T23:32:35+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR]       role: org.apache.maven.wagon.Wagon
[ERROR]   roleHint: https
[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/PluginResolutionException

Why can't maven install or clean.

Cœur
  • 37,241
  • 25
  • 195
  • 267
gdk
  • 89
  • 1
  • 2
  • 11

2 Answers2

8

It seems that this problem occurs when you run Maven with the JDK7.

It worked until April 2019, but then it stopped working failing the Maven build with this error.

Alessandro C
  • 3,310
  • 9
  • 46
  • 82
0

Java 7 uses TLS v1 as default, so open a terminal and run mvn and specify TLS v1.2 version:

mvn -Dhttps.protocols=TLSv1.2 clean install

More info

jhuamanchumo
  • 385
  • 2
  • 7
  • 21