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?

2
  • 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: stackoverflow.com/questions/24673671/…. It's good to provide as much (valuable) info as possible: stackoverflow.com/help/minimal-reproducible-example Commented Jul 15, 2020 at 8:25
  • Yes, I am using Maven. Basically i just scaffolded this project using aws-cdk Maven version is 3.6.2 Commented Jul 15, 2020 at 8:27

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.