You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2006/03/30 18:51:36 UTC

MavenProject.addArtifact()

Hi,

Is it possible to have a Maven.addArtifact() method added?

Someone reported a bug on the clover plugin saying that a dependency was
missing on one project. Here's the code that we currently have:

        Set set = new HashSet( this.project.getDependencyArtifacts() );
        set.add( cloverArtifact );
        this.project.setDependencyArtifacts( set );

I'd rather replace this with a addArtifact() call as the
setDependencyArtrifacts() call above sounds dangerous (we could omit
artifacts). It appears that this is probably the problem we have.

Anyone has any idea what type of artifact we could be missing with the code
above? The person's code builds fine with a normal build; it's just when
clover plugin is run that it fails.

Thanks
-Vincent


	

	
		
___________________________________________________________________________ 
Nouveau : t�l�phonez moins cher avec Yahoo! Messenger ! D�couvez les tarifs exceptionnels pour appeler la France et l'international.
T�l�chargez sur http://fr.messenger.yahoo.com

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


Re: MavenProject.addArtifact()

Posted by Brett Porter <br...@apache.org>.
Vincent Massol wrote:
> 
>> -----Original Message-----
>> From: Brett Porter [mailto:brett@apache.org]
>> Sent: samedi 1 avril 2006 10:36
>> To: Maven Developers List
>> Subject: Re: MavenProject.addArtifact()
>>
>> That's correct. If you want the transitive dependencies, use
>> getArtifacts().
> 
> Does it mean that when using setDependencyArtifacts() the deps are no longer
> transitively resolved after that?

No, they are transitively resolved, but if you are using
getDependencyArtifacts for anything, you only get the direct
dependencies (which will include anything added to the list that is
reset with setDependencyArtifacts).

- Brett

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


RE: MavenProject.addArtifact()

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Brett Porter [mailto:brett@apache.org]
> Sent: samedi 1 avril 2006 10:36
> To: Maven Developers List
> Subject: Re: MavenProject.addArtifact()
> 
> That's correct. If you want the transitive dependencies, use
> getArtifacts().

Does it mean that when using setDependencyArtifacts() the deps are no longer
transitively resolved after that?

> However, for the setting, you need to setDependencyArtifacts due to the
> way they are constructed.
> 
> An add artifact method would be very helpful in a future release.

Added in jira: http://jira.codehaus.org/browse/MNG-2197

Thanks
-Vincent

> Vincent Massol wrote:
> >
> >> -----Original Message-----
> >> From: Brett Porter [mailto:brett@apache.org]
> >> Sent: vendredi 31 mars 2006 00:26
> >> To: Maven Developers List
> >> Subject: Re: MavenProject.addArtifact()
> >>
> >> That code looks fine, it also works in Cobertura. Can you get more
> >> details about the dependency?
> >
> > I got more information and apparently the missing dependency is brought
> > transitively. Is it possible that the getDependencyArtifacts() below
> does
> > not include transitive dependencies?
> >
> > Thanks
> > -Vincent
> >
> >> Vincent Massol wrote:
> >>> Hi,
> >>>
> >>> Is it possible to have a Maven.addArtifact() method added?
> >>>
> >>> Someone reported a bug on the clover plugin saying that a dependency
> was
> >>> missing on one project. Here's the code that we currently have:
> >>>
> >>>         Set set = new HashSet( this.project.getDependencyArtifacts()
> );
> >>>         set.add( cloverArtifact );
> >>>         this.project.setDependencyArtifacts( set );
> >>>
> >>> I'd rather replace this with a addArtifact() call as the
> >>> setDependencyArtrifacts() call above sounds dangerous (we could omit
> >>> artifacts). It appears that this is probably the problem we have.
> >>>
> >>> Anyone has any idea what type of artifact we could be missing with the
> >> code
> >>> above? The person's code builds fine with a normal build; it's just
> when
> >>> clover plugin is run that it fails.
> >>>
> >>> Thanks
> >>> -Vincent
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> __________________________________________________________________________
> >> _
> >>> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> >> tarifs exceptionnels pour appeler la France et l'international.
> >>> Téléchargez sur http://fr.messenger.yahoo.com
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> >
> >
> >
> >
> >
> __________________________________________________________________________
> _
> > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> tarifs exceptionnels pour appeler la France et l'international.
> > Téléchargez sur http://fr.messenger.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

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


Re: MavenProject.addArtifact()

Posted by Brett Porter <br...@apache.org>.
That's correct. If you want the transitive dependencies, use getArtifacts().

However, for the setting, you need to setDependencyArtifacts due to the
way they are constructed.

An add artifact method would be very helpful in a future release.

- Brett

Vincent Massol wrote:
> 
>> -----Original Message-----
>> From: Brett Porter [mailto:brett@apache.org]
>> Sent: vendredi 31 mars 2006 00:26
>> To: Maven Developers List
>> Subject: Re: MavenProject.addArtifact()
>>
>> That code looks fine, it also works in Cobertura. Can you get more
>> details about the dependency?
> 
> I got more information and apparently the missing dependency is brought
> transitively. Is it possible that the getDependencyArtifacts() below does
> not include transitive dependencies?
> 
> Thanks
> -Vincent
> 
>> Vincent Massol wrote:
>>> Hi,
>>>
>>> Is it possible to have a Maven.addArtifact() method added?
>>>
>>> Someone reported a bug on the clover plugin saying that a dependency was
>>> missing on one project. Here's the code that we currently have:
>>>
>>>         Set set = new HashSet( this.project.getDependencyArtifacts() );
>>>         set.add( cloverArtifact );
>>>         this.project.setDependencyArtifacts( set );
>>>
>>> I'd rather replace this with a addArtifact() call as the
>>> setDependencyArtrifacts() call above sounds dangerous (we could omit
>>> artifacts). It appears that this is probably the problem we have.
>>>
>>> Anyone has any idea what type of artifact we could be missing with the
>> code
>>> above? The person's code builds fine with a normal build; it's just when
>>> clover plugin is run that it fails.
>>>
>>> Thanks
>>> -Vincent
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> __________________________________________________________________________
>> _
>>> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
>> tarifs exceptionnels pour appeler la France et l'international.
>>> Téléchargez sur http://fr.messenger.yahoo.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________________________ 
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
> Téléchargez sur http://fr.messenger.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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


RE: MavenProject.addArtifact()

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Brett Porter [mailto:brett@apache.org]
> Sent: vendredi 31 mars 2006 00:26
> To: Maven Developers List
> Subject: Re: MavenProject.addArtifact()
> 
> That code looks fine, it also works in Cobertura. Can you get more
> details about the dependency?

I got more information and apparently the missing dependency is brought
transitively. Is it possible that the getDependencyArtifacts() below does
not include transitive dependencies?

Thanks
-Vincent

> Vincent Massol wrote:
> > Hi,
> >
> > Is it possible to have a Maven.addArtifact() method added?
> >
> > Someone reported a bug on the clover plugin saying that a dependency was
> > missing on one project. Here's the code that we currently have:
> >
> >         Set set = new HashSet( this.project.getDependencyArtifacts() );
> >         set.add( cloverArtifact );
> >         this.project.setDependencyArtifacts( set );
> >
> > I'd rather replace this with a addArtifact() call as the
> > setDependencyArtrifacts() call above sounds dangerous (we could omit
> > artifacts). It appears that this is probably the problem we have.
> >
> > Anyone has any idea what type of artifact we could be missing with the
> code
> > above? The person's code builds fine with a normal build; it's just when
> > clover plugin is run that it fails.
> >
> > Thanks
> > -Vincent
> >
> >
> >
> >
> >
> >
> >
> __________________________________________________________________________
> _
> > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> tarifs exceptionnels pour appeler la France et l'international.
> > Téléchargez sur http://fr.messenger.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

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


Re: MavenProject.addArtifact()

Posted by Brett Porter <br...@apache.org>.
That code looks fine, it also works in Cobertura. Can you get more
details about the dependency?

- Brett

Vincent Massol wrote:
> Hi,
> 
> Is it possible to have a Maven.addArtifact() method added?
> 
> Someone reported a bug on the clover plugin saying that a dependency was
> missing on one project. Here's the code that we currently have:
> 
>         Set set = new HashSet( this.project.getDependencyArtifacts() );
>         set.add( cloverArtifact );
>         this.project.setDependencyArtifacts( set );
> 
> I'd rather replace this with a addArtifact() call as the
> setDependencyArtrifacts() call above sounds dangerous (we could omit
> artifacts). It appears that this is probably the problem we have.
> 
> Anyone has any idea what type of artifact we could be missing with the code
> above? The person's code builds fine with a normal build; it's just when
> clover plugin is run that it fails.
> 
> Thanks
> -Vincent
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________________________ 
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
> Téléchargez sur http://fr.messenger.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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