Reputation: 139
I am new to AWS-CDK and try to build 1 app using AWS-CDK and java language. But getting build related issues with this.
Failed to execute goal on project cdk: Could not resolve dependencies for project com.myorg:cdk:jar:0.1: Could not find artifact com.fasterxml.jackson.core:jackson-databind:jar:2.11.0-SNAPSHOT -> [Help 1]
For me CDK version = <cdk.version>1.45.0</cdk.version>
Any help regarding this?
Upvotes: 0
Views: 1024
Reputation: 139
I got the answer of my problem. artifact com.fasterxml.jackson.core:jackson-databind:jar:2.11.0-SNAPSHOT was having dependecny on awscdk-core. But this dependency was missing in awscdk core. I excluded this dependency from awscdk core and declared as separate dependency. Build worked perfectly.
<dependency>
<groupId>software.amazon.awscdk</groupId>
<artifactId>core</artifactId>
<version>${cdk.version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.0</version>
</dependency>
Upvotes: 1
Reputation: 63
You can try the below options:
Verify your project's external dependencies if the jackson-databind artifact is present. If yes please refresh the maven dependencies if using an IDE, or use clean and build from the cmd line.
If the issue still persists, try calling out the dependency explicitly on the pom.xml, and perform a maven refresh. This should download the dependency from maven repo.
Upvotes: 1