top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How are maven scopes mapped to ivy configurations by ivy?

+2 votes
369 views

Ivy offers the possibility to access maven repositories and download artifacts from there. There are only pom files in those repositories and no ivy.xml.

They can be retrieved with an ivy resolver that runs in m2compatible mode.

<ibiblio name="maven2" m2compatible="true"/>

Especially for this Use-case I want to know:

  1. which scopes are available by default and what artifacts will they offer
  2. How is a maven scoped mapped to an ivy conf / configuration?
posted Oct 1, 2014 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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:

  1. default runtime dependencies and master artifact can be used with this conf
  2. master contains only the artifact published by this module itself, with no transitive dependencies
  3. compile this is the default scope, used if none is specified. Compile dependencies are available in all classpaths
  4. 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
    5 .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
  5. 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
  6. system this scope is similar to provided except that you have to provide the JAR which contains it explicitly.
  7. 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
answer Oct 3, 2014 by Kali Mishra
...