How are maven scopes mapped to ivy configurations by ivy

后端 未结 1 962
逝去的感伤
逝去的感伤 2020-11-22 11:20

Maven repositories, like Maven Repository offer the widest range of projects for dependency management.

Ivy offers the possibility to access maven repositories and d

相关标签:
1条回答
  • 2020-11-22 12:02

    The following two articles helped me to better understand how Maven and Ivy inter-operate

    • http://www.symphonious.net/2010/01/25/using-ivy-for-dependency-management/
    • http://lightguard-jp.blogspot.com/2009/04/ivy-configurations-when-pulling-from.html

    Oddly, I never really understood ivy configurations, until it was explained how they can be used to simulate Maven scopes.

    The following listis from the www.symphonious.net link and illustrates the available configurations from pom-files/maven repositories:

    • default runtime dependencies and master artifact can be used with this conf
    • master contains only the artifact published by this module itself, with no transitive dependencies
    • compile this is the default scope, used if none is specified. Compile dependencies are available in all classpaths
    • provided 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
    • runtime 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
    • test 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
    • system this scope is similar to provided except that you have to provide the JAR which contains it explicitly.
    • sources this configuration contains the source artifact of this module, if any Source for the project
    • javadoc this configuration contains the javadoc artifact of this module, if any JavaDoc for the project
    • optional contains all optional dependencies
    0 讨论(0)
提交回复
热议问题