You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Fabrizio Stellato (Jira)" <ji...@apache.org> on 2020/12/02 14:34:00 UTC

[jira] [Updated] (DELTASPIKE-1421) Cannot exclude ApplicationScoped with @Produces method

     [ https://issues.apache.org/jira/browse/DELTASPIKE-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabrizio Stellato updated DELTASPIKE-1421:
------------------------------------------
    Description: 
I have *ApplicationScoped* beans on the _main_ java folder which work as resources class, therefore they contains methods with _Produces_ annotation .

I'm currently using cucumber + deltaspike dependencies, and when I run my test I can see ALL dependencies are implicit injected.

As I don't want to do that, I decided to exclude those ApplicationScoped classes from _beans.xml_ in this way:
{code:java}
<weld:exclude pattern="^(.*)ServiceProducer$" />
 <weld:exclude pattern="^(.*)LoggerProducer$" />
{code}
When I start my cucumber test, I can see these classes are still scanned, thus I receive ambiguos dependency because of my mock classes on _test_ folder.

Is there any way to exclude above classes with success or, even better, to explicitly add bean classes?

 

  was:
I have *ApplicationScoped* beans on the _main_ java folder which work as resources class, therefore they contains methods with _Produces_ annotation .

I'm currently using cucumber + deltaspike dependencies, and when I run my test I can see ALL dependencies are implicit injected.

As I don't want to do that, I decided to exclude those ApplicationScoped classes from _beans.xml_ in this way:
{code:java}
<weld:exclude pattern="^(.*)ServiceProducer$" />
 <weld:exclude pattern="^(.*)LoggerProducer$" />
{code}
When I start my cucumber test, I still see these classes scanned, thus I receive ambiguos dependency because of my mock classes on _test_ folder.

Is there any way to explicit add dependendat classes?

 


> Cannot exclude ApplicationScoped with @Produces method
> ------------------------------------------------------
>
>                 Key: DELTASPIKE-1421
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1421
>             Project: DeltaSpike
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: CdiControl
>    Affects Versions: 1.9.4
>            Reporter: Fabrizio Stellato
>            Priority: Major
>
> I have *ApplicationScoped* beans on the _main_ java folder which work as resources class, therefore they contains methods with _Produces_ annotation .
> I'm currently using cucumber + deltaspike dependencies, and when I run my test I can see ALL dependencies are implicit injected.
> As I don't want to do that, I decided to exclude those ApplicationScoped classes from _beans.xml_ in this way:
> {code:java}
> <weld:exclude pattern="^(.*)ServiceProducer$" />
>  <weld:exclude pattern="^(.*)LoggerProducer$" />
> {code}
> When I start my cucumber test, I can see these classes are still scanned, thus I receive ambiguos dependency because of my mock classes on _test_ folder.
> Is there any way to exclude above classes with success or, even better, to explicitly add bean classes?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)