0

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?

Hakan Dilek
  • 2,178
  • 2
  • 23
  • 35
Arshad
  • 109
  • 2
  • 10
  • Hi Arshad. Which build tool do you use? (error message looks like from Maven. If yes, then which version 2 or 3? Please edit your question, add proper tag: maven-2 or maven-3). Please attach pom.xml. Please check: https://stackoverflow.com/questions/24673671/mavenerror-failed-to-execute-goal-on-project-could-not-resolve-dependencies-in. It's good to provide as much (valuable) info as possible: https://stackoverflow.com/help/minimal-reproducible-example – greenmarker Jul 15 '20 at 08:25
  • Yes, I am using Maven. Basically i just scaffolded this project using aws-cdk Maven version is 3.6.2 – Arshad Jul 15 '20 at 08:27

2 Answers2

1

You can try the below options:

  1. 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.

  2. 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.

Jey
  • 63
  • 1
  • 6
1

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>
Arshad
  • 109
  • 2
  • 10