Skip to content

mvn 3.8.4 considers an http:// repo an error, and requires https #113

@pdsimanyi

Description

@pdsimanyi

Expected Behavior

mvn compile should succeed.

Actual Behavior

mvn compile produces

[ERROR] Failed to execute goal on project jenkins-spock: Could not resolve dependencies for project com.homeaway.devtools.jenkins:jenkins-spock:jar:2.1.6-SNAPSHOT: Failed to collect dependencies at org.jenkins-ci.main:jenkins-core:jar:2.102: Failed to read artifact descriptor for org.jenkins-ci.main:jenkins-core:jar:2.102: Could not transfer artifact org.jenkins-ci.main:jenkins-core:pom:2.102 from/to maven-default-http-blocker (http://0.0.0.0/): transfer failed for http://0.0.0.0/org/jenkins-ci/main/jenkins-core/2.102/jenkins-core-2.102.pom: Connect to 0.0.0.0:80 [/0.0.0.0] failed: Connection refused (Connection refused) -> [Help 1]

Search results suggest this is because maven's config for newest versions automatically blocks http repos, only allowing https.

Steps to Reproduce

  1. Compile with Java 8. I have
    openjdk version "1.8.0_312"
    OpenJDK Runtime Environment (Zulu 8.58.0.13-CA-macos-aarch64) (build 1.8.0_312-b07)
    OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) (build 25.312-b07, mixed mode)
    on an M1 Mac.
  2. Compile with mvn 3.8.4 or later. (An earlier mvn may have this problem: I didn't find the earliest version.)
  3. If you can't reproduce the error above, please try rm -rf ~/.m2 first.

Additional Information

For me, the change below fixes the problem. Please consider whether changing the repo reference from http to https suffices to fix this in general:
Replacing
http://repo.jenkins-ci.org/releases
with
https://repo.jenkins-ci.org/releases
worked for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions