Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
Las solicitudes a http://repo1.maven.org/maven2/ devuelven un estado 501 HTTPS requerido y un cuerpo

A partir del 15 de enero de 2020, recibo las siguientes respuestas al realizar solicitudes a The Central Repository:

 Requests to http://repo1.maven.org/maven2/ return a 501 HTTPS Required status and a body: 501 HTTPS Required. Use https://repo1.maven.org/maven2/ More information at https://links.sonatype.com/central/501-https-required Requests to http://repo.maven.apache.org/maven2/ return a 501 HTTPS Required status and a body: 501 HTTPS Required. Use https://repo.maven.apache.org/maven2/ More information at https://links.sonatype.com/central/501-https-required

¿Cómo cumplo con este requisito para poder recuperar el acceso a Central?

me sale este error en la consola

 [INFO] Scanning for projects... [INFO] [INFO] ----------------------------< >---------------------------- [INFO] Building demo 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] Downloading from : http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.0/mongo-java-driver-3.12.0.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11.136 s [INFO] Finished at: 2020-01-16T15:27:53+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project demo: Could not resolve dependencies for project com.tcs:demo:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.mongodb:mongo-java-driver:jar:3.12.0: Failed to read artifact descriptor for org.mongodb:mongo-java-driver:jar:3.12.0: Could not transfer artifact org.mongodb:mongo-java-driver:pom:3.12.0 from/to central (http://repo1.maven.org/maven2/): Failed to transfer http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.0/mongo-java-driver-3.12.0.pom. Error code 501, HTTPS Required -> [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/DependencyResolutionException

Y usando el complemento del sitio:

[ERROR] No se pudo ejecutar el objetivo org.apache.maven.plugins:maven-site-plugin:2.2:site (sitio predeterminado) en el proyecto my-proj: SiteToolException: el descriptor del sitio no se puede resolver desde el repositorio: ArtifactResolutionException: no se puede para ubicar el descriptor del sitio: no se pudo transferir el artefacto org.xy:name:xml:site_en:3.5.1.b550 desde/hacia central ( http://repo1.maven.org/maven2 ): la transferencia falló para http://repo1 .maven.org/maven2/org/x/y/3.5.1.b550/name-3.5.1.b550-site_en.xml 501 HTTPS Requerido

over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

A partir del 15 de enero de 2020, el Repositorio central ya no admite la comunicación insegura a través de HTTP simple y requiere que todas las solicitudes al repositorio se cifren a través de HTTPS.

Si recibe este error, debe reemplazar todas las referencias de URL a Maven Central con sus homólogos HTTPS canónicos:

Reemplace http://repo1.maven.org/maven2/ con https://repo1.maven.org/maven2/

Reemplace http://repo.maven.apache.org/maven2/ con https://repo.maven.apache.org/maven2/

Si por algún motivo su entorno no es compatible con HTTPS, tiene la opción de utilizar nuestro extremo inseguro dedicado en http://insecure.repo1.maven.org/maven2/

Para obtener más información sobre el cambio a HTTPS, consulte https://blog.sonatype.com/central-repository-moving-to-https .

over 4 years ago · Santiago Trujillo Report

0

Tenga en cuenta que su pom principal también puede (re)definir repositorios, y si ha anulado el http central y especificado por cualquier motivo, deberá corregirlo (así que lugares para corregir: ~/.m2/settings.xml Y también pompones de los padres).

Si no puede arreglarlo en el pom principal, puede anular el repositorio del pom principal, así, en su pom secundario (extraído del super pom predeterminado 3.6.3, parece que también cambiaron el nombre de repo1):

 <repositories> <repository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> <!-- the https you've been looking for --> <layout>default</layout> <snapshots> <enabled>false</enabled> <!-- or set to false if desired, default is true https://stackoverflow.com/a/61684539/32453 --> </snapshots> </repository> </repositories>
over 4 years ago · Santiago Trujillo Report

0

Intente agregar la siguiente declaración en su pom.xml

 <pluginRepositories> <pluginRepository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> <releases> <updatePolicy>never</updatePolicy> </releases> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>

Además, debe especificar los repositorios en: MAVEN\conf\settings.xml

 <mirrors> <mirror> <id>other-mirror</id> <mirrorOf>central</mirrorOf> <name>Other Mirror Repository</name> <url>http://insecure.repo1.maven.org/maven2/</url> </mirror> <mirror> <id>internal-repository</id> <name>Maven Repository Manager running on https://repo1.maven.org/maven2</name> <url>https://repo1.maven.org/maven2</url> <mirrorOf>*</mirrorOf> </mirror> </mirrors>
over 4 years ago · Santiago Trujillo Report

0

Lo arreglé con los siguientes pasos, pero usa http: 1) llegó a la carpeta .m2 2) creó la configuración del archivo.xml 3) copie y pegue a continuación

 <settings> <mirrors> <mirror> <id>centralhttps</id> <mirrorOf>central</mirrorOf> <name>Maven central https</name> <url>http://insecure.repo1.maven.org/maven2/</url> </mirror> </mirrors> </settings>
over 4 years ago · Santiago Trujillo Report

0

FYI para los usuarios de Gradle solo use,

 repositories { maven { url = 'https://repo.maven.apache.org/maven2' } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!