You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Daniel Kulp <dk...@apache.org> on 2014/02/11 18:43:53 UTC

"optional" dependencies and Maven versions

While working with Art to figure out why his web console war was significantly smaller than mine, we determined that it comes down to what version of Maven you use to build.  3.0.5 includes more jars than 3.1.1.  Looking into it, it looks like 3.1.1 is using the parent poms “optional=true” flags for the transitive dependencies whereas 3.0.5 is not.  

For example, in the parent pom, we have all the spring stuff (spring-core, spring-context, spring-beans, spring-aop) as “optional=true”.      However, in activemq-web, we set spring-web and spring-webmvc to optional=false.   With 3.0.5, the transitive dependencies of spring-webmvc/spring-web then also get changed to optional=false.  However, with 3.1.1, they don’t.  They remain optional=true and thus don’t get packaged into the war.

For consistency sake, I’d like to get this fixed.   Two options:

1) For all the transitive deps pulled in for activemq-web, acttivemq-web-console, etc… add them directly to the deps in those poms with a optional=false flag.

2) Remove the optional=true flag from the parent pom and add it into the other poms where they truly are optional.    Avoid the option=false construct.


Thoughts?    I believe #2 would be more “maven standard”.    

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: "optional" dependencies and Maven versions

Posted by artnaseef <ar...@artnaseef.com>.
Not forcing "optional=true" on all the lower-level dependencies seems like
the more-right way to go.

However, either way should work.

My 2cents - if using the "optional=false", be sure to comment it so that
it's obvious why that's needed.

-art

>
>
>
> While working with Art to figure out why his web console war was
> significantly smaller than mine, we determined that it comes down to what
> version of Maven you use to build.  3.0.5 includes more jars than 3.1.1.
> Looking into it, it looks like 3.1.1 is using the parent poms
> “optional=true” flags for the transitive dependencies whereas 3.0.5 is
> not.
>
> For example, in the parent pom, we have all the spring stuff (spring-core,
> spring-context, spring-beans, spring-aop) as “optional=true”.
> However, in activemq-web, we set spring-web and spring-webmvc to
> optional=false.   With 3.0.5, the transitive dependencies of
> spring-webmvc/spring-web then also get changed to optional=false.
> However, with 3.1.1, they don’t.  They remain optional=true and thus
> don’t get packaged into the war.
>
> For consistency sake, I’d like to get this fixed.   Two options:
>
> 1) For all the transitive deps pulled in for activemq-web,
> acttivemq-web-console, etc… add them directly to the deps in those poms
> with a optional=false flag.
>
> 2) Remove the optional=true flag from the parent pom and add it into the
> other poms where they truly are optional.    Avoid the option=false
> construct.
>
>
> Thoughts?    I believe #2 would be more “maven standard”.
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/optional-dependencies-and-Maven-versions-tp4677817.html
> To start a new topic under ActiveMQ - Dev, email
> ml-node+s2283324n2368404h72@n4.nabble.com
> To unsubscribe from ActiveMQ - Dev, visit
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2368404&code=YXJ0QGFydG5hc2VlZi5jb218MjM2ODQwNHwtMjA1NDcyNjY5MQ==






--
View this message in context: http://activemq.2283324.n4.nabble.com/optional-dependencies-and-Maven-versions-tp4677817p4677834.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: "optional" dependencies and Maven versions

Posted by James Carman <ja...@carmanconsulting.com>.
I don't mind "managing" the dependencies at the root level, but I
would leave it up to submodules to declare exactly what they need in
their pom (pulling in version info from the parent).  Even with that,
I don't really like it that much.  I usually just use properties in
the root to control version numbers and make the submodules use those
properties when they declare their dependencies.


On Tue, Feb 11, 2014 at 2:43 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
> I personally don't really like defining compile/runtime dependencies
> in parent poms (I'm ok with testing dependencies).
>
> On Tue, Feb 11, 2014 at 12:43 PM, Daniel Kulp <dk...@apache.org> wrote:
>>
>> While working with Art to figure out why his web console war was significantly smaller than mine, we determined that it comes down to what version of Maven you use to build.  3.0.5 includes more jars than 3.1.1.  Looking into it, it looks like 3.1.1 is using the parent poms "optional=true" flags for the transitive dependencies whereas 3.0.5 is not.
>>
>> For example, in the parent pom, we have all the spring stuff (spring-core, spring-context, spring-beans, spring-aop) as "optional=true".      However, in activemq-web, we set spring-web and spring-webmvc to optional=false.   With 3.0.5, the transitive dependencies of spring-webmvc/spring-web then also get changed to optional=false.  However, with 3.1.1, they don't.  They remain optional=true and thus don't get packaged into the war.
>>
>> For consistency sake, I'd like to get this fixed.   Two options:
>>
>> 1) For all the transitive deps pulled in for activemq-web, acttivemq-web-console, etc... add them directly to the deps in those poms with a optional=false flag.
>>
>> 2) Remove the optional=true flag from the parent pom and add it into the other poms where they truly are optional.    Avoid the option=false construct.
>>
>>
>> Thoughts?    I believe #2 would be more "maven standard".
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>>
>
>
>
> --
> Hiram Chirino
> Engineering | Red Hat, Inc.
> hchirino@redhat.com | fusesource.com | redhat.com
> skype: hiramchirino | twitter: @hiramchirino

Re: "optional" dependencies and Maven versions

Posted by Hiram Chirino <hi...@hiramchirino.com>.
I personally don't really like defining compile/runtime dependencies
in parent poms (I'm ok with testing dependencies).

On Tue, Feb 11, 2014 at 12:43 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> While working with Art to figure out why his web console war was significantly smaller than mine, we determined that it comes down to what version of Maven you use to build.  3.0.5 includes more jars than 3.1.1.  Looking into it, it looks like 3.1.1 is using the parent poms "optional=true" flags for the transitive dependencies whereas 3.0.5 is not.
>
> For example, in the parent pom, we have all the spring stuff (spring-core, spring-context, spring-beans, spring-aop) as "optional=true".      However, in activemq-web, we set spring-web and spring-webmvc to optional=false.   With 3.0.5, the transitive dependencies of spring-webmvc/spring-web then also get changed to optional=false.  However, with 3.1.1, they don't.  They remain optional=true and thus don't get packaged into the war.
>
> For consistency sake, I'd like to get this fixed.   Two options:
>
> 1) For all the transitive deps pulled in for activemq-web, acttivemq-web-console, etc... add them directly to the deps in those poms with a optional=false flag.
>
> 2) Remove the optional=true flag from the parent pom and add it into the other poms where they truly are optional.    Avoid the option=false construct.
>
>
> Thoughts?    I believe #2 would be more "maven standard".
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>



-- 
Hiram Chirino
Engineering | Red Hat, Inc.
hchirino@redhat.com | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino