jjwt: Could not resolve io.jsonwebtoken:jjwt-api:0.9.1

I’m trying to use jjwt with spring boot and I used gradle like it’s said in the readme of this github like this :

dependencies {
    api 'io.jsonwebtoken:jjwt-api:0.11.2'
    runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.2' 
    runtimeOnly('io.jsonwebtoken:jjwt-orgjson:0.11.2') {
        exclude group: 'org.json', module: 'json' //provided by Android natively
    }

and changed the version from 0.11.2 to 0.9.1 because I’m following this guide that uses this library.

I keep getting this error message even when switching to the newest version:

Could not resolve io.jsonwebtoken:jjwt-api:0.9.1.

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

@Mark-i7 did that jjwt 0.9.1 solution work for you? neither that or these worked for me: <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-api</artifactId> <version>0.11.5</version> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-impl</artifactId> <version>0.11.5</version> <scope>runtime</scope> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-jackson</artifactId> <version>0.11.5</version> <scope>runtime</scope> </dependency>

@hadestructhor There is no jjwt-api version 0.9.x, that was introduced in 0.10.0. See for example https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api. The question is why you need to downgrade though.

@scharrua Your dependency is just fine, which should resolve normally. See https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt/0.9.1.

To me, this doesn’t sound like an issue of jjwt, just a misconfiguration.

@AlisonPAnderson

You are a genius

@Tobyha01 if you are using intellij idea (ctrl+shift+o) it might solve the problem

@Mark-i7 just added the following lines to my pom.xml file:

		<!--  JWT Dependencies for authentication process -->	
		<!--  from tutorial https://bezkoder.com/spring-boot-jwt-authentication/  -->	 		
				
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		
		<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
		<dependency>
		    <groupId>io.jsonwebtoken</groupId>
		    <artifactId>jjwt</artifactId>
		    <version>0.9.1</version>
		</dependency>
		
       <!--  end of JWT Dependencies --> 	
		

Artifact names changed with the 0.10.x release, so when you downgraded below 0.10.x, the names were incorrect. Please read the following for the correct current names:

https://github.com/jwtk/jjwt#install