[ 
https://issues.apache.org/jira/browse/MRESOLVER-298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17675711#comment-17675711
 ] 

ASF GitHub Bot commented on MRESOLVER-298:
------------------------------------------

michael-o commented on PR #235:
URL: https://github.com/apache/maven-resolver/pull/235#issuecomment-1379453059

   > > Call me stupid, but what makes it optional now? That the providers don't 
appear in the annoations and this avoids the transitive dep to `javax.inject`?
   > 
   > No dependency or dep scope was changed, it was code, here 
https://github.com/apache/maven-resolver/pull/235/files#diff-530cadfdf6c10eff31703c1c50c7121f9c72c64a4f55c156428c7cc1113e6950R77-R86
 This `private static` method is used with default ctor (when SL is used) and 
expected Provider on classpath. This is not the case anymore.
   > 
   > Simple proof: the "demo snippets" now work from IDE (they have main 
method), before this change, on current master they do NOT work due same issue 
(as javax.inject is only in test scope).
   
   This is basically what I meant. The Provider had to be there...




> javax.inject should not be provided or optional
> -----------------------------------------------
>
>                 Key: MRESOLVER-298
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-298
>             Project: Maven Resolver
>          Issue Type: Bug
>            Reporter: Olivier Lamy
>            Priority: Major
>             Fix For: 1.10.0
>
>
> Using resolver in a non DI context and got this exception
> {code}
> java.lang.NoClassDefFoundError: javax/inject/Provider
>       at 
> org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl.getManuallyCreatedNameMappers(NamedLockFactoryAdapterFactoryImpl.java:85)
>       at 
> org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl.<init>(NamedLockFactoryAdapterFactoryImpl.java:117)
>       at 
> jdk.internal.reflect.GeneratedConstructorAccessor26.newInstance(Unknown 
> Source)
> {code}
> This is because javax.inject is declared as provided and/or optional whereas 
> it's not.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to