background
A Spark project uses Maven for dependency management and is developed in Scala. When I first pulled the project code and tried to package it, MAVEN was unable to pull some dependencies, but the settings.xml file was configured with no problems
The specific error
1. The warehouse address cannot be accessed
A class of errors contains the message could not transfer artifact maven-default-http-blocker (http://0.0.0.0/):) Blocked Mirror for Repositories: It then lists the locations of many repositories that are blocked
If this is the case, first make sure that you have access to the repository and that you have similar Settings configured in your settings.xml file
<servers>
<! - get on messenger: http://mirrors.tencent.com/#/private/maven - >
<server>
<id>id</id>
<username>username</username>
<password>password</password>
</server>
</servers>
Copy the code
Such a token, if not, may not have access
If yes, you can add a
configuration under the
TAB
<mirror>
<id>insecure-repo</id>
<mirrorOf>external:http:*</mirrorOf>
<url>http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/</url>
<blocked>false</blocked>
</mirror>
Copy the code
If adding this configuration doesn’t work, or if the
tag doesn’t exist at all, you can downgrade the maven version
2. Failed to build
Error message: It may be an unbuildable error reported by some plug-ins
In this case, you should find the error in the error message to see if there is a problem with the code, which is usually the case
conclusion
Don’t panic when you encounter errors. The most common thing Java class projects do is version errors. Make sure there are no problems with version dependencies.
First make sure the code is fine, and generally don’t use the latest version!