Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 常春藤';s url解析器是否支持传递检索?_Java_Ant_Build Automation_Ivy - Fatal编程技术网

Java 常春藤';s url解析器是否支持传递检索?

Java 常春藤';s url解析器是否支持传递检索?,java,ant,build-automation,ivy,Java,Ant,Build Automation,Ivy,由于某些原因,在使用url解析器指定存储库位置时,我似乎无法解析依赖项的依赖项。但是,当使用ibiblio解析器时,我能够检索它们 例如: <!-- Ivy File --> <ivy-module version="1.0"> <info organisation="org.apache" module="chained-resolvers"/> <dependencies> <dependency org="commons-lan

由于某些原因,在使用url解析器指定存储库位置时,我似乎无法解析依赖项的依赖项。但是,当使用ibiblio解析器时,我能够检索它们

例如:

<!-- Ivy File -->
<ivy-module version="1.0">
<info organisation="org.apache" module="chained-resolvers"/>
<dependencies>
    <dependency org="commons-lang" name="commons-lang" rev="2.0" conf="default"/>
    <dependency org="checkstyle" name="checkstyle" rev="5.0"/>
</dependencies>
</ivy-module>


<!-- ivysettings file -->
<ivysettings>
<settings defaultResolver="chained"/>
  <resolvers>
    <chain name="chained">
      <url name="custom-repo">
        <ivy pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/ivy-[revision].xml"/>
        <artifact pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
      </url>
      <url name="ibiblio-mirror" m2compatible="true">
        <artifact pattern="http://mirrors.ibiblio.org/pub/mirrors/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
      </url>
      <ibiblio name="ibiblio" m2compatible="true"/>
    </chain>
  </resolvers>
</ivysettings>


<!-- checkstyle ivy.xml file generated from pom via ivy:install task -->
    <?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="checkstyle"
        module="checkstyle"
        revision="5.0"
        status="release"
        publication="20090509202448"
        namespace="maven2"
    >
        <license name="GNU Lesser General Public License" url="http://www.gnu.org/licenses/lgpl.txt" />
        <description homepage="http://checkstyle.sourceforge.net/">
        Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard
        </description>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="checkstyle" type="jar" ext="jar" conf="master"/>
    </publications>
    <dependencies>
        <dependency org="antlr" name="antlr" rev="2.7.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="apache" name="commons-beanutils-core" rev="1.7.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="apache" name="commons-cli" rev="1.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="apache" name="commons-logging" rev="1.0.3" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="com.google.collections" name="google-collections" rev="0.9" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
    </dependencies>
</ivy-module>

Checkstyle是一种开发工具,用于帮助程序员编写符合编码标准的Java代码
使用“ibiblio”解析器,我可以解决项目的两个依赖项(commons lang 2.0和checkstyle 5.0)和checkstyle的依赖项。但是,当尝试独占使用“自定义repo”或“ibiblio镜像”解析器时,我能够解析项目的两个显式定义的依赖项,但不能解析checkstyle的依赖项


这可能吗?任何帮助都将不胜感激。

原因是您没有为“ibibio镜像”解析器指定常春藤图案。您的镜像应该看起来像(不要忘记[classifier]标记):


但您也可以将ibiblio解析器用于镜像:

  <ibiblio name="ibiblio-mirror" root="http://mirrors.ibiblio.org/pub/mirrors/maven2/" m2compatible="true"/>


Maarten

Maarten,感谢您的回复,但是您的第一个解决方案似乎不起作用,因为只有我在我的ivy.xml中列出的两个依赖项正在被解决。但是,将ibiblio解析器与自定义根一起使用部分有效。我之所以这么说,部分原因是当我在pattern属性中指定一个新的pattern布局时,Ivy似乎忽略了它,并继续使用它的默认模式。有什么想法吗?这是我正在尝试的解决方案:关于您的自定义ibiblio模式的问题,您能用Ivy trunk版本再试一次吗?您可能会遇到此处报告的问题:。
  <ibiblio name="ibiblio-mirror" root="http://mirrors.ibiblio.org/pub/mirrors/maven2/" m2compatible="true"/>