You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jacob Beard <jb...@cs.mcgill.ca> on 2010/08/26 01:23:38 UTC

Which dependency scope is most appropriate for dependencies of the build script itself?

Hi,

I've just read the Introduction to the Dependency Mechanism document: 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

My project still relies heavily on Ant for building, but I'm migrating 
to Maven for dependency management, among other things.

There are several libraries that are used in my project's Ant build 
script, but not in the application itself. Examples of these include 
ant-contrib, bean scripting framework, and commons-logging. I'm 
wondering, what Maven dependency scope is most appropriate for these 
kinds of dependencies? It seems tricky, because these dependencies are 
required for neither compilation nor execution of the project's source 
code, but are instead required for executing the build script.

Let me know what you think. Thanks,

Jake

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Stephen Connolly <st...@gmail.com>.
Also you should be aware that, in general, things which could affect the
build plan are not allowed to come from the current reactor.

For example, if you are creating a maven plugin as part of your reactor
build, you are not allowed to depend on the version of that plugin that is
being built by your reactor build, as that would mean that the build plan
cannot be constructed until the build is half way through and the new plugin
could actually turn the build plan on its head.

There are two solutions to this kind of issue:
  1. Move the plugin/dependency to a separate reactor that is released
independently
  2. Depend on the previous version of the plugin/dependency and update the
version after every release

The preferred solution is #1 but #2 is sometimes necessary.

-Stephen

On 26 August 2010 05:40, Anders Hammar <an...@hammar.net> wrote:

> If you're using Maven 2.x, be aware of MANTRUN-95 [1]. I suggest you use
> latest Maven 3.0 beta and you will not have this problem.
>
> /Anders
>
> [1] http://jira.codehaus.org/browse/MANTRUN-95
>
> On Thu, Aug 26, 2010 at 04:20, Justin Edelson <justinedelson@gmail.com
> >wrote:
>
> > It is a general feature.
> >
> > On Aug 25, 2010, at 10:00 PM, Jacob Beard <jb...@cs.mcgill.ca> wrote:
> >
> > > Great, that appears to be exactly what I was looking for.
> > >
> > > One more question: is injecting new dependencies for specific plugins
> > something that can be done in general, or only for antrun?
> > >
> > > Jake
> > >
> > > On 10-08-25 09:04 PM, Justin Edelson wrote:
> > >> The latter. See
> >
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.htmlforthe syntax.
> > >>
> > >> On Aug 25, 2010, at 8:35 PM, Jacob Beard<jb...@cs.mcgill.ca>
>  wrote:
> > >>
> > >>
> > >>> Hi,
> > >>>
> > >>> Thanks for the reply.
> > >>>
> > >>> I'm brand new to Maven, and so I don't quite understand what you
> mean.
> > Are you saying that the antrun plugin itself should include these
> libraries
> > as dependencies; or is it possible, in my project, to inject new
> > dependencies for specific plugins, beyond what they specify on their own?
> > >>>
> > >>> Please let me know. Thanks,
> > >>>
> > >>> Jake
> > >>>
> > >>> On 10-08-25 08:01 PM, Justin Edelson wrote:
> > >>>
> > >>>> Shouldn't these just be dependencies of the antrun plugin instead of
> > >>>> your project?
> > >>>>
> > >>>> On 8/25/10 7:23 PM, Jacob Beard wrote:
> > >>>>
> > >>>>
> > >>>>> Hi,
> > >>>>>
> > >>>>> I've just read the Introduction to the Dependency Mechanism
> document:
> > >>>>>
> >
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
> > >>>>>
> > >>>>>
> > >>>>> My project still relies heavily on Ant for building, but I'm
> > migrating
> > >>>>> to Maven for dependency management, among other things.
> > >>>>>
> > >>>>> There are several libraries that are used in my project's Ant build
> > >>>>> script, but not in the application itself. Examples of these
> include
> > >>>>> ant-contrib, bean scripting framework, and commons-logging. I'm
> > >>>>> wondering, what Maven dependency scope is most appropriate for
> these
> > >>>>> kinds of dependencies? It seems tricky, because these dependencies
> > are
> > >>>>> required for neither compilation nor execution of the project's
> > source
> > >>>>> code, but are instead required for executing the build script.
> > >>>>>
> > >>>>> Let me know what you think. Thanks,
> > >>>>>
> > >>>>> Jake
> > >>>>>
> > >>>>>
> ---------------------------------------------------------------------
> > >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >>>>> For additional commands, e-mail: users-help@maven.apache.org
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>
> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >>>> For additional commands, e-mail: users-help@maven.apache.org
> > >>>>
> > >>>>
> > >>>>
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >>> For additional commands, e-mail: users-help@maven.apache.org
> > >>>
> > >>>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Anders Hammar <an...@hammar.net>.
If you're using Maven 2.x, be aware of MANTRUN-95 [1]. I suggest you use
latest Maven 3.0 beta and you will not have this problem.

/Anders

[1] http://jira.codehaus.org/browse/MANTRUN-95

On Thu, Aug 26, 2010 at 04:20, Justin Edelson <ju...@gmail.com>wrote:

> It is a general feature.
>
> On Aug 25, 2010, at 10:00 PM, Jacob Beard <jb...@cs.mcgill.ca> wrote:
>
> > Great, that appears to be exactly what I was looking for.
> >
> > One more question: is injecting new dependencies for specific plugins
> something that can be done in general, or only for antrun?
> >
> > Jake
> >
> > On 10-08-25 09:04 PM, Justin Edelson wrote:
> >> The latter. See
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.htmlfor the syntax.
> >>
> >> On Aug 25, 2010, at 8:35 PM, Jacob Beard<jb...@cs.mcgill.ca>  wrote:
> >>
> >>
> >>> Hi,
> >>>
> >>> Thanks for the reply.
> >>>
> >>> I'm brand new to Maven, and so I don't quite understand what you mean.
> Are you saying that the antrun plugin itself should include these libraries
> as dependencies; or is it possible, in my project, to inject new
> dependencies for specific plugins, beyond what they specify on their own?
> >>>
> >>> Please let me know. Thanks,
> >>>
> >>> Jake
> >>>
> >>> On 10-08-25 08:01 PM, Justin Edelson wrote:
> >>>
> >>>> Shouldn't these just be dependencies of the antrun plugin instead of
> >>>> your project?
> >>>>
> >>>> On 8/25/10 7:23 PM, Jacob Beard wrote:
> >>>>
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I've just read the Introduction to the Dependency Mechanism document:
> >>>>>
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
> >>>>>
> >>>>>
> >>>>> My project still relies heavily on Ant for building, but I'm
> migrating
> >>>>> to Maven for dependency management, among other things.
> >>>>>
> >>>>> There are several libraries that are used in my project's Ant build
> >>>>> script, but not in the application itself. Examples of these include
> >>>>> ant-contrib, bean scripting framework, and commons-logging. I'm
> >>>>> wondering, what Maven dependency scope is most appropriate for these
> >>>>> kinds of dependencies? It seems tricky, because these dependencies
> are
> >>>>> required for neither compilation nor execution of the project's
> source
> >>>>> code, but are instead required for executing the build script.
> >>>>>
> >>>>> Let me know what you think. Thanks,
> >>>>>
> >>>>> Jake
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Justin Edelson <ju...@gmail.com>.
It is a general feature.

On Aug 25, 2010, at 10:00 PM, Jacob Beard <jb...@cs.mcgill.ca> wrote:

> Great, that appears to be exactly what I was looking for.
> 
> One more question: is injecting new dependencies for specific plugins something that can be done in general, or only for antrun?
> 
> Jake
> 
> On 10-08-25 09:04 PM, Justin Edelson wrote:
>> The latter. See http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html for the syntax.
>> 
>> On Aug 25, 2010, at 8:35 PM, Jacob Beard<jb...@cs.mcgill.ca>  wrote:
>> 
>>   
>>> Hi,
>>> 
>>> Thanks for the reply.
>>> 
>>> I'm brand new to Maven, and so I don't quite understand what you mean. Are you saying that the antrun plugin itself should include these libraries as dependencies; or is it possible, in my project, to inject new dependencies for specific plugins, beyond what they specify on their own?
>>> 
>>> Please let me know. Thanks,
>>> 
>>> Jake
>>> 
>>> On 10-08-25 08:01 PM, Justin Edelson wrote:
>>>     
>>>> Shouldn't these just be dependencies of the antrun plugin instead of
>>>> your project?
>>>> 
>>>> On 8/25/10 7:23 PM, Jacob Beard wrote:
>>>> 
>>>>       
>>>>> Hi,
>>>>> 
>>>>> I've just read the Introduction to the Dependency Mechanism document:
>>>>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>>>>> 
>>>>> 
>>>>> My project still relies heavily on Ant for building, but I'm migrating
>>>>> to Maven for dependency management, among other things.
>>>>> 
>>>>> There are several libraries that are used in my project's Ant build
>>>>> script, but not in the application itself. Examples of these include
>>>>> ant-contrib, bean scripting framework, and commons-logging. I'm
>>>>> wondering, what Maven dependency scope is most appropriate for these
>>>>> kinds of dependencies? It seems tricky, because these dependencies are
>>>>> required for neither compilation nor execution of the project's source
>>>>> code, but are instead required for executing the build script.
>>>>> 
>>>>> Let me know what you think. Thanks,
>>>>> 
>>>>> Jake
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>>> 
>>>>>         
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>>>>       
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>>     
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Jacob Beard <jb...@cs.mcgill.ca>.
Great, that appears to be exactly what I was looking for.

One more question: is injecting new dependencies for specific plugins 
something that can be done in general, or only for antrun?

Jake

On 10-08-25 09:04 PM, Justin Edelson wrote:
> The latter. See http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html for the syntax.
>
> On Aug 25, 2010, at 8:35 PM, Jacob Beard<jb...@cs.mcgill.ca>  wrote:
>
>    
>> Hi,
>>
>> Thanks for the reply.
>>
>> I'm brand new to Maven, and so I don't quite understand what you mean. Are you saying that the antrun plugin itself should include these libraries as dependencies; or is it possible, in my project, to inject new dependencies for specific plugins, beyond what they specify on their own?
>>
>> Please let me know. Thanks,
>>
>> Jake
>>
>> On 10-08-25 08:01 PM, Justin Edelson wrote:
>>      
>>> Shouldn't these just be dependencies of the antrun plugin instead of
>>> your project?
>>>
>>> On 8/25/10 7:23 PM, Jacob Beard wrote:
>>>
>>>        
>>>> Hi,
>>>>
>>>> I've just read the Introduction to the Dependency Mechanism document:
>>>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>>>>
>>>>
>>>> My project still relies heavily on Ant for building, but I'm migrating
>>>> to Maven for dependency management, among other things.
>>>>
>>>> There are several libraries that are used in my project's Ant build
>>>> script, but not in the application itself. Examples of these include
>>>> ant-contrib, bean scripting framework, and commons-logging. I'm
>>>> wondering, what Maven dependency scope is most appropriate for these
>>>> kinds of dependencies? It seems tricky, because these dependencies are
>>>> required for neither compilation nor execution of the project's source
>>>> code, but are instead required for executing the build script.
>>>>
>>>> Let me know what you think. Thanks,
>>>>
>>>> Jake
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>          
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Justin Edelson <ju...@gmail.com>.
The latter. See http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html for the syntax.

On Aug 25, 2010, at 8:35 PM, Jacob Beard <jb...@cs.mcgill.ca> wrote:

> Hi,
> 
> Thanks for the reply.
> 
> I'm brand new to Maven, and so I don't quite understand what you mean. Are you saying that the antrun plugin itself should include these libraries as dependencies; or is it possible, in my project, to inject new dependencies for specific plugins, beyond what they specify on their own?
> 
> Please let me know. Thanks,
> 
> Jake
> 
> On 10-08-25 08:01 PM, Justin Edelson wrote:
>> Shouldn't these just be dependencies of the antrun plugin instead of
>> your project?
>> 
>> On 8/25/10 7:23 PM, Jacob Beard wrote:
>>   
>>> Hi,
>>> 
>>> I've just read the Introduction to the Dependency Mechanism document:
>>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>>> 
>>> 
>>> My project still relies heavily on Ant for building, but I'm migrating
>>> to Maven for dependency management, among other things.
>>> 
>>> There are several libraries that are used in my project's Ant build
>>> script, but not in the application itself. Examples of these include
>>> ant-contrib, bean scripting framework, and commons-logging. I'm
>>> wondering, what Maven dependency scope is most appropriate for these
>>> kinds of dependencies? It seems tricky, because these dependencies are
>>> required for neither compilation nor execution of the project's source
>>> code, but are instead required for executing the build script.
>>> 
>>> Let me know what you think. Thanks,
>>> 
>>> Jake
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>>     
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Jacob Beard <jb...@cs.mcgill.ca>.
Hi,

Thanks for the reply.

I'm brand new to Maven, and so I don't quite understand what you mean. 
Are you saying that the antrun plugin itself should include these 
libraries as dependencies; or is it possible, in my project, to inject 
new dependencies for specific plugins, beyond what they specify on their 
own?

Please let me know. Thanks,

Jake

On 10-08-25 08:01 PM, Justin Edelson wrote:
> Shouldn't these just be dependencies of the antrun plugin instead of
> your project?
>
> On 8/25/10 7:23 PM, Jacob Beard wrote:
>    
>> Hi,
>>
>> I've just read the Introduction to the Dependency Mechanism document:
>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>>
>>
>> My project still relies heavily on Ant for building, but I'm migrating
>> to Maven for dependency management, among other things.
>>
>> There are several libraries that are used in my project's Ant build
>> script, but not in the application itself. Examples of these include
>> ant-contrib, bean scripting framework, and commons-logging. I'm
>> wondering, what Maven dependency scope is most appropriate for these
>> kinds of dependencies? It seems tricky, because these dependencies are
>> required for neither compilation nor execution of the project's source
>> code, but are instead required for executing the build script.
>>
>> Let me know what you think. Thanks,
>>
>> Jake
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>      
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Which dependency scope is most appropriate for dependencies of the build script itself?

Posted by Justin Edelson <ju...@gmail.com>.
Shouldn't these just be dependencies of the antrun plugin instead of
your project?

On 8/25/10 7:23 PM, Jacob Beard wrote:
> Hi,
> 
> I've just read the Introduction to the Dependency Mechanism document:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
> 
> 
> My project still relies heavily on Ant for building, but I'm migrating
> to Maven for dependency management, among other things.
> 
> There are several libraries that are used in my project's Ant build
> script, but not in the application itself. Examples of these include
> ant-contrib, bean scripting framework, and commons-logging. I'm
> wondering, what Maven dependency scope is most appropriate for these
> kinds of dependencies? It seems tricky, because these dependencies are
> required for neither compilation nor execution of the project's source
> code, but are instead required for executing the build script.
> 
> Let me know what you think. Thanks,
> 
> Jake
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org