[ 
https://issues.apache.org/jira/browse/CASSANDRA-16359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17250619#comment-17250619
 ] 

Michael Semb Wever edited comment on CASSANDRA-16359 at 12/16/20, 8:29 PM:
---------------------------------------------------------------------------

An example {{~/.m2/settings.xml}} file to get around this problem
{code}
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd";>

  <profiles>
    <profile>
      <id>use-https-for-central</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
        <repositories>
           <repository>
              <id>central</id>
              <name>Central Maven repository https</name>
              <url>https://repo.maven.apache.org/maven2</url>
           </repository>
           <repository>
              <id>central</id>
              <name>Central Maven repository https</name>
              <url>https://repo1.maven.org/maven2</url>
           </repository>
        </repositories>
    </profile>
  </profiles>
</settings>
{code}


was (Author: michaelsembwever):
An example {{~/.m2/settings.xml}} file to get around this problem
{code}
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd";>


  <profiles>
    <profile>
      <id>use-https-for-central</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
        <repositories>
           <repository>
              <id>central</id>
              <name>Central Maven repository https</name>
              <url>https://repo.maven.apache.org/maven2</url>
           </repository>
           <repository>
              <id>central</id>
              <name>Central Maven repository https</name>
              <url>https://repo1.maven.org/maven2</url>
           </repository>
        </repositories>
    </profile>
  </profiles>
</settings>
{code}

> mvn-install fails if no repo mirror is defined in settings.xml
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-16359
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16359
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Build
>            Reporter: Gianluca Righetto
>            Priority: Normal
>
> Running {{ant mvn-install}} on Docker (image maven:3-openjdk-11) fails 
> because [maven-ant-tasks|https://maven.apache.org/ant-tasks/index.html] tries 
> to download some jars from Maven Central through HTTP instead of HTTPS. HTTP 
> access to Central is not allowed anymore since the beginning of the year.
> If you have an https mirror defined in your Maven settings.xml, you won't 
> notice that problem though.
> {noformat}
> mvn-install:
> [artifact:mvn] Downloading: 
> org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom from repository 
> central at http://repo1.maven.org/maven2
> [artifact:mvn] Error transferring file: Server returned HTTP response code: 
> 501 for URL: 
> http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom
> [artifact:mvn] [WARNING] Unable to get resource 
> 'org.apache.maven:apache-maven:pom:3.0.3' from repository central 
> (http://repo1.maven.org/maven2): Error transferring file: Server returned 
> HTTP response code: 501 for URL: 
> http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom
> [artifact:mvn] Downloading: 
> org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom from repository 
> central at http://repo1.maven.org/maven2
> [artifact:mvn] Error transferring file: Server returned HTTP response code: 
> 501 for URL: 
> http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom
> [artifact:mvn] [WARNING] Unable to get resource 
> 'org.apache.maven:apache-maven:pom:3.0.3' from repository central 
> (http://repo1.maven.org/maven2): Error transferring file: Server returned 
> HTTP response code: 501 for URL: 
> http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.0.3/apache-maven-3.0.3.pom
>      [null] An error has occurred while processing the Maven artifact tasks.
>      [null]  Diagnosis:
>      [null] 
>      [null] Unable to resolve artifact: Missing:
>      [null] ----------
>      [null] 1) org.apache.maven:apache-maven:pom:3.0.3
>      [null]   Path to dependency: 
>      [null]           1) org.apache.maven:super-pom:pom:2.0
>      [null]           2) org.apache.maven:apache-maven:pom:3.0.3
>      [null] 
>      [null] ----------
>      [null] 1 required artifact is missing.
>      [null] 
>      [null] for artifact: 
>      [null]   org.apache.maven:super-pom:pom:2.0
>      [null] 
>      [null] from the specified remote repositories:
>      [null]   central (http://repo1.maven.org/maven2)
>      [null] 
>      [null] 
> BUILD FAILED
> /workspace/cassandra/build.xml:2365: The following error occurred while 
> executing this line:
> /workspace/cassandra/build.xml:490: Unable to resolve artifact: Missing:
> ----------
> 1) org.apache.maven:apache-maven:pom:3.0.3
>   Path to dependency: 
>       1) org.apache.maven:super-pom:pom:2.0
>       2) org.apache.maven:apache-maven:pom:3.0.3
> ----------
> 1 required artifact is missing.
> for artifact: 
>   org.apache.maven:super-pom:pom:2.0
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to