guymahieu / ivyidea

Resolve dependencies for your Intellij projects using Ivy
Apache License 2.0
13 stars 18 forks source link

Ivy Configurations matchup to Intellij Library Scope. #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In Ivy we create 3 configurations meant to follow maven dependancy scope   
(compile, provided, test).   Then when we specify a dependency we mark which 
configuration it is part of.   Intellij library allows for scope to be defined 
for a given library.   The IvyIdea plugin however does not allow us to take 
advantage of specifying a scope per ivy configuration.   We are forced to have 
a single ivy library file per module and cannot take advantage of specifying 
scope.

Here is an example ivy file.

 <configurations defaultconfmapping="compile->default" >
        <conf name="compile" visibility="private" description="compile with no transitive dependencies" />
        <conf name="provided" visibility="private" description="provided by container" />
        <conf name="test" visibility="private" description="test shared"/>
    </configurations>

   <dependencies>
        <dependency org="com.google.protobuf" name="protobuf-java" rev="${version.protobuf-java}"  transitive="false"/>
        <dependency org="javax" name="javaee-api" rev="${version.javaee-api}" conf="provided->default"/>
        <dependency org="junit" name="junit" rev="${version.junit}" conf="test->default" transitive="false"/>  
    </dependencies>

I would like to be able to separate the multiple configurations in a single 
ivy.xml file into different ivyidea libraries and then be able to assign a 
scope to each one.

What version of the product are you using? On what operating system?
IntelliJ 12.1.1  - IvyIdea - 1.0.4

Original issue reported on code.google.com by kevind.f...@gmail.com on 19 Apr 2013 at 9:52

GoogleCodeExporter commented 8 years ago
Possible workaround:
1. Go to Idea settings(Project settings) -> Resolved library settings.
2. Check Include configuration name.
3. Run Ivy to resolve dependencies.
4. Go to module dependencies - there should be one Ivy library per 
configuration.
5. Set scope of test libraries as 'Test.

Original comment by fi0...@gmail.com on 10 Jun 2013 at 3:14