2

I have an eclipse project with IvyDE managed dependencies

My IvyDE is something like:

<ivy-module version="2.0" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
     <info organisation="R01"
           module="myModule"
           status="integration">
     </info>

     <configurations>
         <conf name="compile" description="Used only at compile time; not deployed to the server" />
         <conf name="runtime" extends="compile" description="Deployed to the server"/>
     </configurations>

     <dependencies>
         <dependency org="com.sun.jersey" name="jersey-core" rev="1.9.1" conf="runtime"/>            
         <dependency org="javax.ws.rs" name="jsr311-api" rev="1.1.1" conf="compile"/>
     </dependencies>
</ivy-module>

I have dependencies needed at compile-time and dependencies needed at runtime

I don't know if this is possible with apache IVY in eclipse (IvyDE) but I want to deploy to the server ONLY the RUNTIME-dependencies.

Now the only solution I've found is:

  • set IvyDE to resolve ALL (compile + runtime) dependencies and set the module classpath
  • add the [Ivy] library to the [DeploymentAssembly] at the project properties

This way all the dependencies (including the compile-time dependencies) are deployed to the server...

Is there any way to achieve this???

Thanks in advance

futuretelematics
  • 1,453
  • 11
  • 23

1 Answers1

2

I answer my own question.

Finally I managed to get have TWO different ivy-managed classpath libraries, one used at compile-time and the other at run-time

detail of the two ivy-managed classpath libraries

The trick is include TWO ivyDE-managed dependencies:

add ivyDE managed dependency

One ivyDE managed dependency should be for COMPILE configuration and the other for RUNTIME configuration:

ivyDE config selection

(repeat for the RUNTIME configuration)

Then it's only a matter of setting:

  • ivy dependency for COMPILE config should be a [Project Library]
  • ivy dependency for RUNTIME config should be at [Deployment Assembly]

That's all!

futuretelematics
  • 1,453
  • 11
  • 23
  • +1 for making my day. I had the exact same problem having the Ivy-classpath-container deploying the runtime libs (websocket-api in this case) to the tomcat deployment folder. Seperating the two configurations into two distinct ivy classpath entries solved this problem. Thanks to @futuretelematics proposal. – Sebastian Götz Mar 15 '16 at 16:07