如何在ivy中强制使用HTTPS?

huangapple go评论96阅读模式
英文:

How to enforce HTTPS in ivy?

问题

以下是您的内容的中文翻译:

这是我的ivy.xml文件。

<ivy-module version="2.0">
    <info organisation="kairosd.org" module="kairosdb"/>
    <configurations defaultconf="default" >
        <conf name="default"/>
        <conf name="integration" extends="test"/>
        <conf name="test" extends="default"/>
    </configurations>
    <dependencies>
        <!-- 在这里列出了各种依赖 -->
    </dependencies>
</ivy-module>

ivysettings.xml文件:

<ivysettings>
    <settings defaultResolver="default"/>
    <resolvers>
        <!-- 在这里列出了各种解析器 -->
    </resolvers>
</ivysettings>

这是我收到的错误信息。

===============================================
Ivy解析依赖关系。
:: 问题摘要 ::
:::: 警告
找不到模块:junit#junit;4.12

==== central: 尝试

  http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom

  -- artifact junit#junit;4.12!junit.jar:

  http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar

找不到模块:org.hamcrest#hamcrest-library;1.3

==== central: 尝试

  http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom

  -- artifact org.hamcrest#hamcrest-library;1.3!hamcrest-library.jar:

  http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar

找不到模块:org.mockito#mockito-core;2.13.0

==== central: 尝试

  http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.pom

  -- artifact org.mockito#mockito-core;2.13.0!mockito-core.jar:

  http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.jar

找不到模块:org.testng#testng;6.8.5

==== central: 尝试

  http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.pom

  -- artifact org.testng#testng;6.8.5!testng.jar:

  http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.jar

::::::::::::::::::::::::::::::::::::::::::::::

::          未解决的依赖关系          ::

::::::::::::::::::::::::::::::::::::::::::::::

:: junit#junit;4.12: 未找到

:: org.hamcrest#hamcrest-library;1.3: 未找到

:: org.mockito#mockito-core;2.13.0: 未找到

:: org.testng#testng;6.8.5: 未找到

::::::::::::::::::::::::::::::::::::::::::::::

:::: 错误
服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.pom

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.jar

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.pom

服务器错误:HTTPS Required url=http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.jar
===============================================
我认为错误是由于强制执行HTTPS导致的。如何处理?
英文:

Here is my ivy.xml.

&lt;ivy-module version=&quot;2.0&quot;&gt;
&lt;info organisation=&quot;kairosd.org&quot; module=&quot;kairosdb&quot;/&gt;
&lt;configurations defaultconf=&quot;default&quot; &gt;
&lt;conf name=&quot;default&quot;/&gt;
&lt;conf name=&quot;integration&quot; extends=&quot;test&quot;/&gt;
&lt;conf name=&quot;test&quot; extends=&quot;default&quot;/&gt;
&lt;/configurations&gt;
&lt;dependencies&gt;
&lt;dependency org=&quot;com.google.guava&quot; name=&quot;guava&quot; rev=&quot;19.0&quot; force=&quot;true&quot;&gt;
&lt;artifact name=&quot;guava&quot; type=&quot;bundle&quot; ext=&quot;jar&quot;/&gt;
&lt;/dependency&gt;
&lt;dependency org=&quot;com.github.rholder&quot; name=&quot;guava-retrying&quot; rev=&quot;2.0.0&quot; /&gt;
&lt;dependency org=&quot;org.apache.commons&quot; name=&quot;commons-lang3&quot; rev=&quot;3.4&quot; /&gt;
&lt;dependency org=&quot;org.apache.commons&quot; name=&quot;commons-collections4&quot; rev=&quot;4.1&quot; /&gt;
&lt;dependency org=&quot;org.json&quot; name=&quot;org.json&quot; rev=&quot;chargebee-1.0&quot; /&gt;
&lt;dependency org=&quot;com.google.code.gson&quot; name=&quot;gson&quot; rev=&quot;2.2.4&quot; /&gt;
&lt;dependency org=&quot;junit&quot; name=&quot;junit&quot; rev=&quot;4.12&quot; conf=&quot;test-&gt;default&quot; /&gt;
&lt;dependency org=&quot;org.hamcrest&quot; name=&quot;hamcrest-library&quot; rev=&quot;1.3&quot;
conf=&quot;test-&gt;default&quot;/&gt;
&lt;dependency org=&quot;org.mockito&quot; name=&quot;mockito-core&quot; rev=&quot;2.13.0&quot; conf=&quot;test-&gt;default&quot;/&gt;
&lt;dependency org=&quot;io.netty&quot; name=&quot;netty&quot; rev=&quot;3.10.6.Final&quot; /&gt;
&lt;dependency org=&quot;org.powermock&quot; name=&quot;powermock-module-junit4&quot; rev=&quot;1.4.12&quot; /&gt;--&gt;
&lt;dependency org=&quot;com.google.inject&quot; name=&quot;guice&quot; rev=&quot;4.1.0&quot; /&gt;
&lt;dependency org=&quot;com.google.inject.extensions&quot;
name=&quot;guice-multibindings&quot; rev=&quot;4.1.0&quot;/&gt;
&lt;dependency org=&quot;com.google.inject.extensions&quot; name=&quot;guice-assistedinject&quot; rev=&quot;4.1.0&quot; /&gt;
&lt;dependency org=&quot;com.google.inject.extensions&quot; name=&quot;guice-servlet&quot; rev=&quot;4.1.0&quot; /&gt;
&lt;dependency org=&quot;com.h2database&quot; name=&quot;h2&quot; rev=&quot;1.3.170&quot; /&gt;
&lt;dependency org=&quot;se.ugli.bigqueue&quot; name=&quot;bigqueue&quot; rev=&quot;1.6.0.0&quot; /&gt;
&lt;!-- provides connection pooling --&gt;
&lt;dependency org=&quot;c3p0&quot; name=&quot;c3p0&quot; rev=&quot;0.9.1.2&quot;/&gt;
&lt;dependency org=&quot;org.slf4j&quot; name=&quot;slf4j-api&quot; rev=&quot;1.7.2&quot; /&gt;
&lt;dependency org=&quot;org.slf4j&quot; name=&quot;jul-to-slf4j&quot; rev=&quot;1.7.2&quot; /&gt;
&lt;dependency org=&quot;org.apache.commons&quot; name=&quot;commons-math3&quot; rev=&quot;3.2&quot; /&gt;
&lt;dependency org=&quot;commons-io&quot; name=&quot;commons-io&quot; rev=&quot;2.5&quot; /&gt;
&lt;dependency org=&quot;com.beust&quot; name=&quot;jcommander&quot; rev=&quot;1.35&quot; /&gt;
&lt;dependency org=&quot;org.apache.httpcomponents&quot; name=&quot;httpclient&quot; rev=&quot;4.3.6&quot; /&gt;
&lt;dependency org=&quot;joda-time&quot; name=&quot;joda-time&quot; rev=&quot;2.3&quot; /&gt;
&lt;dependency org=&quot;ch.qos.logback&quot; name=&quot;logback-core&quot; rev=&quot;1.1.7&quot; /&gt;
&lt;dependency org=&quot;ch.qos.logback&quot; name=&quot;logback-classic&quot; rev=&quot;1.1.7&quot; /&gt;
&lt;!--Genormous dependencies--&gt;
&lt;dependency org=&quot;org.agileclick.genorm&quot; name=&quot;genormous&quot; rev=&quot;1.6.4.jdbc41&quot;&gt;
&lt;exclude org=&quot;javax.servlet&quot; name=&quot;servlet-api&quot;/&gt;
&lt;exclude org=&quot;org.agileclick.slickxml&quot; name=&quot;slickxml&quot;/&gt;
&lt;exclude org=&quot;org.agileclick.ultramc&quot; name=&quot;ultramc&quot;/&gt;
&lt;/dependency&gt;
&lt;dependency org=&quot;jaxen&quot; name=&quot;jaxen&quot; rev=&quot;1.1.6&quot; transitive=&quot;false&quot;&gt;
&lt;artifact name=&quot;jaxen&quot; type=&quot;jar&quot;/&gt;
&lt;/dependency&gt;
&lt;!-- Cassandra Client --&gt;
&lt;dependency org=&quot;com.datastax.cassandra&quot; name=&quot;cassandra-driver-core&quot; rev=&quot;3.3.2&quot; /&gt;
&lt;dependency org=&quot;net.jpountz.lz4&quot; name=&quot;lz4&quot; rev=&quot;1.3.0&quot;/&gt;
&lt;!-- Jetty server stuff --&gt;
&lt;dependency org=&quot;org.eclipse.jetty&quot; name=&quot;jetty-server&quot;
rev=&quot;8.1.16.v20140903&quot;/&gt;
&lt;dependency org=&quot;org.eclipse.jetty&quot; name=&quot;jetty-servlet&quot;
rev=&quot;8.1.16.v20140903&quot;/&gt;
&lt;dependency org=&quot;org.eclipse.jetty&quot; name=&quot;jetty-servlets&quot;
rev=&quot;8.1.16.v20140903&quot;/&gt;
&lt;dependency org=&quot;org.eclipse.jetty.orbit&quot; name=&quot;javax.servlet&quot; rev=&quot;3.0.0.v201112011016&quot;&gt;
&lt;artifact name=&quot;javax.servlet&quot; type=&quot;orbit&quot; ext=&quot;jar&quot;/&gt;
&lt;/dependency&gt;
&lt;!--Jersey--&gt;
&lt;dependency org=&quot;com.sun.jersey.contribs&quot; name=&quot;jersey-guice&quot;
rev=&quot;1.18.3&quot;/&gt;
&lt;dependency org=&quot;com.sun.jersey&quot; name=&quot;jersey-server&quot; rev=&quot;1.18.3&quot;/&gt;
&lt;dependency org=&quot;com.fasterxml.jackson.jaxrs&quot; name=&quot;jackson-jaxrs-json-provider&quot; rev=&quot;2.2.3&quot;/&gt;
&lt;dependency org=&quot;com.sun.jersey&quot; name=&quot;jersey-core&quot; rev=&quot;1.18.3&quot;/&gt;
&lt;dependency org=&quot;com.sun.jersey&quot; name=&quot;jersey-servlet&quot; rev=&quot;1.18.3&quot;
transitive=&quot;false&quot;/&gt;
&lt;dependency org=&quot;com.sun.jersey.contribs.jersey-oauth&quot; name=&quot;oauth-signature&quot; rev=&quot;1.18.3&quot; /&gt;
&lt;dependency org=&quot;com.sun.jersey.contribs.jersey-oauth&quot; name=&quot;oauth-server&quot; rev=&quot;1.18.3&quot; /&gt;
&lt;!-- Pulse --&gt;
&lt;dependency org=&quot;javax.validation&quot; name=&quot;validation-api&quot; rev=&quot;1.0.0.GA&quot;/&gt;
&lt;dependency org=&quot;org.apache.bval&quot; name=&quot;bval-jsr303&quot; rev=&quot;0.5&quot;/&gt;
&lt;dependency org=&quot;com.google.code.findbugs&quot; name=&quot;jsr305&quot; rev=&quot;1.3.9&quot;/&gt;
&lt;!-- Quartz --&gt;
&lt;dependency org=&quot;org.quartz-scheduler&quot; name=&quot;quartz&quot; rev=&quot;2.1.7&quot; /&gt;
&lt;!-- Codehale Metrics --&gt;
&lt;dependency org=&quot;com.codahale.metrics&quot; name=&quot;metrics-healthchecks&quot;
rev=&quot;3.0.2&quot;/&gt;
&lt;dependency org=&quot;com.codahale.metrics&quot; name=&quot;metrics-jvm&quot; rev=&quot;3.0.2&quot;/&gt;
&lt;dependency org=&quot;org.testng&quot; name=&quot;testng&quot; rev=&quot;6.8.5&quot; conf=&quot;integration-&gt;default&quot;/&gt;
&lt;!-- Prometheus --&gt;
&lt;dependency org=&quot;io.prometheus&quot; name=&quot;simpleclient&quot; rev=&quot;0.1.0&quot;/&gt;
&lt;dependency org=&quot;io.prometheus&quot; name=&quot;simpleclient_common&quot; rev=&quot;0.1.0&quot;/&gt;
&lt;dependency org=&quot;io.prometheus&quot; name=&quot;simpleclient_httpserver&quot; rev=&quot;0.1.0&quot;/&gt;
&lt;/dependencies&gt;
&lt;/ivy-module&gt;

ivysettings.xml:

&lt;ivysettings&gt;
&lt;settings defaultResolver=&quot;default&quot;/&gt;
&lt;resolvers&gt;
&lt;ibiblio name=&quot;local-m2&quot; m2compatible=&quot;true&quot;
root=&quot;file://${user.home}/.m2/repository&quot;
changingPattern=&quot;.*SNAPSHOT&quot;/&gt;
&lt;!--&lt;ibiblio name=&quot;my-maven&quot; m2compatible=&quot;true&quot; root=&quot;http://repo.maven.apache.org/maven2/&quot;/&gt;--&gt;
&lt;!--&lt;ibiblio name=&quot;staging&quot; m2compatible=&quot;true&quot; root=&quot;https://oss.sonatype.org/content/repositories/orgagileclick-1008&quot;/&gt;--&gt;
&lt;ibiblio name=&quot;central&quot; m2compatible=&quot;true&quot;/&gt;
&lt;filesystem name=&quot;local-m2-publish&quot; m2compatible=&quot;true&quot;&gt;
&lt;artifact
pattern=&quot;${user.home}/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]&quot;/&gt;
&lt;/filesystem&gt;
&lt;filesystem name=&quot;local-m2-publish-snapshot&quot; m2compatible=&quot;true&quot;&gt;
&lt;artifact
pattern=&quot;${user.home}/.m2/repository/[organisation]/[module]/[revision]-SNAPSHOT/[artifact]-[revision]-SNAPSHOT.[ext]&quot;/&gt;
&lt;/filesystem&gt;
&lt;chain name=&quot;default&quot;&gt;
&lt;resolver ref=&quot;central&quot;/&gt;
&lt;!--&lt;resolver ref=&quot;staging&quot;/&gt;--&gt;
&lt;!--&lt;resolver ref=&quot;local-m2&quot;/&gt;--&gt;
&lt;/chain&gt;
&lt;/resolvers&gt;
&lt;/ivysettings&gt;

This is the error I get.

===============================================
Ivy resolving dependencies.
:: problems summary ::
:::: WARNINGS
module not found: junit#junit;4.12
==== central: tried
http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom
-- artifact junit#junit;4.12!junit.jar:
http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar
module not found: org.hamcrest#hamcrest-library;1.3
==== central: tried
http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom
-- artifact org.hamcrest#hamcrest-library;1.3!hamcrest-library.jar:
http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar
module not found: org.mockito#mockito-core;2.13.0
==== central: tried
http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.pom
-- artifact org.mockito#mockito-core;2.13.0!mockito-core.jar:
http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.jar
module not found: org.testng#testng;6.8.5
==== central: tried
http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.pom
-- artifact org.testng#testng;6.8.5!testng.jar:
http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.jar
::::::::::::::::::::::::::::::::::::::::::::::
::          UNRESOLVED DEPENDENCIES         ::
::::::::::::::::::::::::::::::::::::::::::::::
:: junit#junit;4.12: not found
:: org.hamcrest#hamcrest-library;1.3: not found
:: org.mockito#mockito-core;2.13.0: not found
:: org.testng#testng;6.8.5: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.pom
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/mockito/mockito-core/2.13.0/mockito-core-2.13.0.jar
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.pom
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.jar
Exception tablesaw.TablesawException: Unable to resolve dependencies
Unable to resolve dependencies
===============================================

I think the error is due to HTTPS enforcement. How to do it?

答案1

得分: 9

我通过添加一个解析器 my-maven,并使用 https 根路径进行了修复,并将其添加到链中。如果我更改中央解析器的根路径,它也应该能正常工作。

<ivysettings>
    <settings defaultResolver="default"/>
    <resolvers>
        <ibiblio name="local-m2" m2compatible="true"
                 root="file://${user.home}/.m2/repository"
                 changingPattern=".*SNAPSHOT"/>
        <ibiblio name="my-maven" m2compatible="true" root="https://repo1.maven.org/maven2/"/>
        <!--<ibiblio name="staging" m2compatible="true" root="https://oss.sonatype.org/content/repositories/orgagileclick-1008"/>-->
        <ibiblio name="central" m2compatible="true"/>

        <filesystem name="local-m2-publish" m2compatible="true">
            <artifact
                    pattern="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
        </filesystem>

        <filesystem name="local-m2-publish-snapshot" m2compatible="true">
            <artifact
                    pattern="${user.home}/.m2/repository/[organisation]/[module]/[revision]-SNAPSHOT/[artifact]-[revision]-SNAPSHOT.[ext]"/>
        </filesystem>

        <chain name="default">
            <resolver ref="central"/>
            <resolver ref="my-maven"/>
            <!--<resolver ref="local-m2"/>-->
        </chain>
    </resolvers>
</ivysettings>
英文:

I fixed it by adding a resolver, my-maven, with https root and add it to the chain. It should also work if I change the root of the central resolver.

&lt;ivysettings&gt;
&lt;settings defaultResolver=&quot;default&quot;/&gt;
&lt;resolvers&gt;
&lt;ibiblio name=&quot;local-m2&quot; m2compatible=&quot;true&quot;
root=&quot;file://${user.home}/.m2/repository&quot;
changingPattern=&quot;.*SNAPSHOT&quot;/&gt;
&lt;ibiblio name=&quot;my-maven&quot; m2compatible=&quot;true&quot; root=&quot;https://repo1.maven.org/maven2/&quot;/&gt;
&lt;!--&lt;ibiblio name=&quot;staging&quot; m2compatible=&quot;true&quot; root=&quot;https://oss.sonatype.org/content/repositories/orgagileclick-1008&quot;/&gt;--&gt;
&lt;ibiblio name=&quot;central&quot; m2compatible=&quot;true&quot;/&gt;
&lt;filesystem name=&quot;local-m2-publish&quot; m2compatible=&quot;true&quot;&gt;
&lt;artifact
pattern=&quot;${user.home}/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]&quot;/&gt;
&lt;/filesystem&gt;
&lt;filesystem name=&quot;local-m2-publish-snapshot&quot; m2compatible=&quot;true&quot;&gt;
&lt;artifact
pattern=&quot;${user.home}/.m2/repository/[organisation]/[module]/[revision]-SNAPSHOT/[artifact]-[revision]-SNAPSHOT.[ext]&quot;/&gt;
&lt;/filesystem&gt;
&lt;chain name=&quot;default&quot;&gt;
&lt;resolver ref=&quot;central&quot;/&gt;
&lt;resolver ref=&quot;my-maven&quot;/&gt;
&lt;!--&lt;resolver ref=&quot;local-m2&quot;/&gt;--&gt;
&lt;/chain&gt;
&lt;/resolvers&gt;
&lt;/ivysettings&gt;

答案2

得分: 0

Sure, here's the translation:

而且...关于您放置ivysettings.xml文件的位置,请尝试与您的build.xml文件相同的目录,参见https://stackoverflow.com/questions/1195393/where-do-you-put-ivysettings-xml

英文:

and... about where you put that ivysettings.xml file, try the same dir as your build.xml see https://stackoverflow.com/questions/1195393/where-do-you-put-ivysettings-xml

答案3

得分: 0

请还尝试删除位于以下位置的旧版ivy:

"C:\Users\userhome\.ant\lib\ivy.jar"

英文:

Please also try deleting older version of ivy from :

> "C:\Users\userhome\.ant\lib\ivy.jar"

答案4

得分: 0

我也遇到了相同的问题。将ivy.jar从2.1.0升级到2.4.0解决了这个问题。

英文:

I had the same. Upgrade ivy.jar from 2.1.0 to 2.4.0 fixed the problem.

huangapple
  • 本文由 发表于 2020年4月9日 13:43:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/61114676.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定