英文:
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.
<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>
<dependency org="com.google.guava" name="guava" rev="19.0" force="true">
<artifact name="guava" type="bundle" ext="jar"/>
</dependency>
<dependency org="com.github.rholder" name="guava-retrying" rev="2.0.0" />
<dependency org="org.apache.commons" name="commons-lang3" rev="3.4" />
<dependency org="org.apache.commons" name="commons-collections4" rev="4.1" />
<dependency org="org.json" name="org.json" rev="chargebee-1.0" />
<dependency org="com.google.code.gson" name="gson" rev="2.2.4" />
<dependency org="junit" name="junit" rev="4.12" conf="test->default" />
<dependency org="org.hamcrest" name="hamcrest-library" rev="1.3"
conf="test->default"/>
<dependency org="org.mockito" name="mockito-core" rev="2.13.0" conf="test->default"/>
<dependency org="io.netty" name="netty" rev="3.10.6.Final" />
<dependency org="org.powermock" name="powermock-module-junit4" rev="1.4.12" />-->
<dependency org="com.google.inject" name="guice" rev="4.1.0" />
<dependency org="com.google.inject.extensions"
name="guice-multibindings" rev="4.1.0"/>
<dependency org="com.google.inject.extensions" name="guice-assistedinject" rev="4.1.0" />
<dependency org="com.google.inject.extensions" name="guice-servlet" rev="4.1.0" />
<dependency org="com.h2database" name="h2" rev="1.3.170" />
<dependency org="se.ugli.bigqueue" name="bigqueue" rev="1.6.0.0" />
<!-- provides connection pooling -->
<dependency org="c3p0" name="c3p0" rev="0.9.1.2"/>
<dependency org="org.slf4j" name="slf4j-api" rev="1.7.2" />
<dependency org="org.slf4j" name="jul-to-slf4j" rev="1.7.2" />
<dependency org="org.apache.commons" name="commons-math3" rev="3.2" />
<dependency org="commons-io" name="commons-io" rev="2.5" />
<dependency org="com.beust" name="jcommander" rev="1.35" />
<dependency org="org.apache.httpcomponents" name="httpclient" rev="4.3.6" />
<dependency org="joda-time" name="joda-time" rev="2.3" />
<dependency org="ch.qos.logback" name="logback-core" rev="1.1.7" />
<dependency org="ch.qos.logback" name="logback-classic" rev="1.1.7" />
<!--Genormous dependencies-->
<dependency org="org.agileclick.genorm" name="genormous" rev="1.6.4.jdbc41">
<exclude org="javax.servlet" name="servlet-api"/>
<exclude org="org.agileclick.slickxml" name="slickxml"/>
<exclude org="org.agileclick.ultramc" name="ultramc"/>
</dependency>
<dependency org="jaxen" name="jaxen" rev="1.1.6" transitive="false">
<artifact name="jaxen" type="jar"/>
</dependency>
<!-- Cassandra Client -->
<dependency org="com.datastax.cassandra" name="cassandra-driver-core" rev="3.3.2" />
<dependency org="net.jpountz.lz4" name="lz4" rev="1.3.0"/>
<!-- Jetty server stuff -->
<dependency org="org.eclipse.jetty" name="jetty-server"
rev="8.1.16.v20140903"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet"
rev="8.1.16.v20140903"/>
<dependency org="org.eclipse.jetty" name="jetty-servlets"
rev="8.1.16.v20140903"/>
<dependency org="org.eclipse.jetty.orbit" name="javax.servlet" rev="3.0.0.v201112011016">
<artifact name="javax.servlet" type="orbit" ext="jar"/>
</dependency>
<!--Jersey-->
<dependency org="com.sun.jersey.contribs" name="jersey-guice"
rev="1.18.3"/>
<dependency org="com.sun.jersey" name="jersey-server" rev="1.18.3"/>
<dependency org="com.fasterxml.jackson.jaxrs" name="jackson-jaxrs-json-provider" rev="2.2.3"/>
<dependency org="com.sun.jersey" name="jersey-core" rev="1.18.3"/>
<dependency org="com.sun.jersey" name="jersey-servlet" rev="1.18.3"
transitive="false"/>
<dependency org="com.sun.jersey.contribs.jersey-oauth" name="oauth-signature" rev="1.18.3" />
<dependency org="com.sun.jersey.contribs.jersey-oauth" name="oauth-server" rev="1.18.3" />
<!-- Pulse -->
<dependency org="javax.validation" name="validation-api" rev="1.0.0.GA"/>
<dependency org="org.apache.bval" name="bval-jsr303" rev="0.5"/>
<dependency org="com.google.code.findbugs" name="jsr305" rev="1.3.9"/>
<!-- Quartz -->
<dependency org="org.quartz-scheduler" name="quartz" rev="2.1.7" />
<!-- Codehale Metrics -->
<dependency org="com.codahale.metrics" name="metrics-healthchecks"
rev="3.0.2"/>
<dependency org="com.codahale.metrics" name="metrics-jvm" rev="3.0.2"/>
<dependency org="org.testng" name="testng" rev="6.8.5" conf="integration->default"/>
<!-- Prometheus -->
<dependency org="io.prometheus" name="simpleclient" rev="0.1.0"/>
<dependency org="io.prometheus" name="simpleclient_common" rev="0.1.0"/>
<dependency org="io.prometheus" name="simpleclient_httpserver" rev="0.1.0"/>
</dependencies>
</ivy-module>
ivysettings.xml:
<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="http://repo.maven.apache.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="staging"/>-->
<!--<resolver ref="local-m2"/>-->
</chain>
</resolvers>
</ivysettings>
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.
<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>
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论