Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Not able to use Auth0 in my AEM application

Avatar

Level 1

Hi Team,

I am trying to use this  dependency

 <dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>[1.0, 2.0)</version>
</dependency>
when I use this dependency in pom it is getting conlict with this import statement 
"import org.jetbrains.annotations.NotNull" from org.jetbrains.annotations and build is failed with error "package org.jetbrains.annotations does not exist". How to fix this issue?


Thanks Bala.
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @BalasaiNikhilKacharla, Instead of relying on a version range, try explicitly specifying the version of mvc-auth-commons that works with your project's other dependencies.

<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>1.0.1</version> <!-- Use the appropriate version -->
</dependency>

If the conflict persists, you can use Maven's exclusion feature to exclude the conflicting transitive dependency. For example:

<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>1.0.1</version>
  <exclusions>
    <exclusion>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
    </exclusion>
  </exclusions>
</dependency>

 

 

 

 

View solution in original post

4 Replies

Hi @Sudheer_Sundalam 


Compile error occurs irrespective of IDE.


The build fails when I add "mvc-auth-commons" dependency in main pom.xml and core pom.xml and gave build in cmd prompt , irrespective of IDE, and gives "package org.jetbrains.annotations does not exist".


Here the build was success in cmd prompt when this dependency was not there,

 

<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>[1.0, 2.0)</version>
</dependency>


Is it conflict between "mvc-auth-commons" dependency and org.jetbrains.annotations.




Avatar

Correct answer by
Community Advisor

Hi @BalasaiNikhilKacharla, Instead of relying on a version range, try explicitly specifying the version of mvc-auth-commons that works with your project's other dependencies.

<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>1.0.1</version> <!-- Use the appropriate version -->
</dependency>

If the conflict persists, you can use Maven's exclusion feature to exclude the conflicting transitive dependency. For example:

<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>mvc-auth-commons</artifactId>
  <version>1.0.1</version>
  <exclusions>
    <exclusion>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
    </exclusion>
  </exclusions>
</dependency>