You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by buzzterrier <te...@gmail.com> on 2008/06/02 20:21:18 UTC
Re: Configurations really hard to understand
I am new to Ivy coming over from Maven, and I too am having difficulty
figuring out configurations (glad I am not alone <g>). I like Xavier's
suggestion below about providing a set of mappings that are similar to
Maven's scopes. Did this idea get dropped? If so, perhaps you could update
the documentation to show how you would implemented a "provided" scoped
dependency in Ivy.
I have what should be a simple problem. We have an in-house commonToolsApi
that has a "provided" scoped dependency on servlet-api. I build and publish
this jar so it is available for other applications. We have a web app that
depends on commonToolsApi.jar. When I build the web app, servlet-api always
gets added to the lib directory. I know this should be trivial to fix using
configurations but after several attempts, it always gets add. Which means I
really don't understand what is going on. I realize that eventually the
light bulb will go off, but right now I feel pretty dim.<g>
Xavier Hanin wrote:
>
> Maybe configuration mapping is too difficult to understand... I agree that
> maven 2 scopes are easier to use for average users, at least until you
> reach
> their limitations (if ever). Therefore we should maybe provide a set of
> configurations and the associated mapping (something similar to maven 2
> scopes maybe), and still make it possible to use your own conf mapping. In
> this case users not needing specific things could almost ignore
> configuration mapping.
>
> What do you think?
>
> Xavier
>
> --
> Xavier Hanin - Independent Java Consultant
> http://xhab.blogspot.com/
> http://incubator.apache.org/ivy/
> http://www.xoocode.org/
>
>
--
View this message in context: http://www.nabble.com/Problem-with-host-name-over-https-tp12053693p17607004.html
Sent from the ivy-user mailing list archive at Nabble.com.
RE: Configurations really hard to understand
Posted by "Loehr, Ruel" <rl...@pointserve.com>.
Shouldn't the servlet api just be a compile time need? I would try doing this:
//i make the servlet api a compile time dependency. At runtime, your servlet container should have it
//when you publish this module, you would need to publish the runtime configuration at minimum.
//i haven't used the defaultconfmapping before as an fyi, not sure what behavior that will change
<ivy-module version="1.0">
<info organisation="com.foo" module="coreTools"/>
<configurations defaultconfmapping="runtime->runtime(*)">
<conf name="runtime" description="Run Time dependencies"/>
<conf name="compile" description="compile time dependencies"/>
</configurations>
<dependencies>
<dependency org="javax.servlet" name="servlet-api" rev="2.4"
conf="compile"/>
</dependencies>
</ivy-module>
<ivy-module version="1.0">
<info organisation="com.foo" module="reports"/>
<configurations defaultconfmapping="compile->compile(*)">
<conf name="compile" description="Build Time dependencies"/>
</configurations>
<dependencies>
//here i say i want to use coretools in my compile configuration and I want to to use published runtime configuration (it should not have servelt api).
<dependency name="coreTools" rev="latest.integration" conf="compile->runtime"/>
.....
</ivy-module>
________________________________________
From: buzzterrier [terry.jeske@gmail.com]
Sent: Monday, June 02, 2008 2:29 PM
To: ivy-user@ant.apache.org
Subject: RE: Configurations really hard to understand
Thx Ruel,
I created a "runtime" conf on the servlet-api dependency on my coreTools
api. I then added coreTools api as a dependency in my web app, but gave it a
"compile" conf. Since the web app was using a "compile" configuration, I
thought that it would ignore the "runtime" dependency on coreTools api.
for example, here is the coreTools api:
<ivy-module version="1.0">
<info organisation="com.foo" module="coreTools"/>
<configurations defaultconfmapping="runtime->runtime(*)">
<conf name="runtime" description="Run Time dependencies"/>
</configurations>
<dependencies>
<dependency org="javax.servlet" name="servlet-api" rev="2.4"
conf="runtime"/>
</dependencies>
</ivy-module>
and here is the web app using a compile conf:
<ivy-module version="1.0">
<info organisation="com.foo" module="reports"/>
<configurations defaultconfmapping="compile->compile(*)">
<conf name="compile" description="Build Time dependencies"/>
</configurations>
<dependencies>
<dependency name="coreTools" rev="latest.integration" conf="compile"/>
.....
</ivy-module>
But building the reports module still pulls down servlet-api from coreTools.
[ivy:retrieve] confs: [compile]
[ivy:retrieve] found com.foo#coreTools;10 in projects
[ivy:retrieve] [10] com.foo#coreTools;latest.integration
[ivy:retrieve] found javax.servlet#servlet-api;2.4 in libraries
ruel loehr wrote:
>
> Yes, I struggled with it too at first.
>
> In my main project, I usually publish a directory config called runtime
> which just has the absolute necessary runtime dependencies.
>
> Then for any project which consumes my original one, I define a compile
> configuration which "eat" the runtime one.
>
> conf="compile->runtime"
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-host-name-over-https-tp12053693p17608947.html
Sent from the ivy-user mailing list archive at Nabble.com.
RE: Configurations really hard to understand
Posted by buzzterrier <te...@gmail.com>.
Thx Ruel,
I created a "runtime" conf on the servlet-api dependency on my coreTools
api. I then added coreTools api as a dependency in my web app, but gave it a
"compile" conf. Since the web app was using a "compile" configuration, I
thought that it would ignore the "runtime" dependency on coreTools api.
for example, here is the coreTools api:
<ivy-module version="1.0">
<info organisation="com.foo" module="coreTools"/>
<configurations defaultconfmapping="runtime->runtime(*)">
<conf name="runtime" description="Run Time dependencies"/>
</configurations>
<dependencies>
<dependency org="javax.servlet" name="servlet-api" rev="2.4"
conf="runtime"/>
</dependencies>
</ivy-module>
and here is the web app using a compile conf:
<ivy-module version="1.0">
<info organisation="com.foo" module="reports"/>
<configurations defaultconfmapping="compile->compile(*)">
<conf name="compile" description="Build Time dependencies"/>
</configurations>
<dependencies>
<dependency name="coreTools" rev="latest.integration" conf="compile"/>
.....
</ivy-module>
But building the reports module still pulls down servlet-api from coreTools.
[ivy:retrieve] confs: [compile]
[ivy:retrieve] found com.foo#coreTools;10 in projects
[ivy:retrieve] [10] com.foo#coreTools;latest.integration
[ivy:retrieve] found javax.servlet#servlet-api;2.4 in libraries
ruel loehr wrote:
>
> Yes, I struggled with it too at first.
>
> In my main project, I usually publish a directory config called runtime
> which just has the absolute necessary runtime dependencies.
>
> Then for any project which consumes my original one, I define a compile
> configuration which "eat" the runtime one.
>
> conf="compile->runtime"
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-host-name-over-https-tp12053693p17608947.html
Sent from the ivy-user mailing list archive at Nabble.com.
RE: Configurations really hard to understand
Posted by "Loehr, Ruel" <rl...@pointserve.com>.
Yes, I struggled with it too at first.
In my main project, I usually publish a directory config called runtime which just has the absolute necessary runtime dependencies.
Then for any project which consumes my original one, I define a compile configuration which "eat" the runtime one.
conf="compile->runtime"
________________________________________
From: buzzterrier [terry.jeske@gmail.com]
Sent: Monday, June 02, 2008 1:21 PM
To: ivy-user@ant.apache.org
Subject: Re: Configurations really hard to understand
I am new to Ivy coming over from Maven, and I too am having difficulty
figuring out configurations (glad I am not alone <g>). I like Xavier's
suggestion below about providing a set of mappings that are similar to
Maven's scopes. Did this idea get dropped? If so, perhaps you could update
the documentation to show how you would implemented a "provided" scoped
dependency in Ivy.
I have what should be a simple problem. We have an in-house commonToolsApi
that has a "provided" scoped dependency on servlet-api. I build and publish
this jar so it is available for other applications. We have a web app that
depends on commonToolsApi.jar. When I build the web app, servlet-api always
gets added to the lib directory. I know this should be trivial to fix using
configurations but after several attempts, it always gets add. Which means I
really don't understand what is going on. I realize that eventually the
light bulb will go off, but right now I feel pretty dim.<g>
Xavier Hanin wrote:
>
> Maybe configuration mapping is too difficult to understand... I agree that
> maven 2 scopes are easier to use for average users, at least until you
> reach
> their limitations (if ever). Therefore we should maybe provide a set of
> configurations and the associated mapping (something similar to maven 2
> scopes maybe), and still make it possible to use your own conf mapping. In
> this case users not needing specific things could almost ignore
> configuration mapping.
>
> What do you think?
>
> Xavier
>
> --
> Xavier Hanin - Independent Java Consultant
> http://xhab.blogspot.com/
> http://incubator.apache.org/ivy/
> http://www.xoocode.org/
>
>
--
View this message in context: http://www.nabble.com/Problem-with-host-name-over-https-tp12053693p17607004.html
Sent from the ivy-user mailing list archive at Nabble.com.