aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

Maven Lambda debugging should support submodules

Open hongbofan opened this issue 3 years ago • 10 comments

Your Environment

  • OS: WINDOWS 10
  • JetBrains product: IntelliJ IDEA
  • JetBrains product version: 2022.1.2
  • AWS Toolkit version:1.48-221
  • SAM CLI version:2.7.18
  • JVM/Python version:jdk8 屏幕截图 2022-07-28 211208

Question

Build Failed
Error: Unable to find a supported build workflow for runtime 'java8'. Reason: None of the supported manifests '['build.gradle', 'build.gradle.kts', 'pom.xml']'

Is CodeUri wrong?

hongbofan avatar Jul 28 '22 13:07 hongbofan

CodeUri should be pointing to the folder containing the pom.xml because SAM CLI will perform the mvn package for you.

rli avatar Jul 29 '22 16:07 rli

CodeUri should be pointing to the folder containing the pom.xml because SAM CLI will perform the mvn package for you.

[FATAL] Non-resolvable parent POM if the CodeUri is ../

hongbofan avatar Jul 31 '22 11:07 hongbofan

CodeUri should be pointing to the folder containing the pom.xml because SAM CLI will perform the mvn package for you.

[FATAL] Non-resolvable parent POM if add <relativePath>../pom.xml</relativePath> to POM

hongbofan avatar Jul 31 '22 11:07 hongbofan

CodeUri should be pointing to the folder containing the pom.xml because SAM CLI will perform the mvn package for you.

[FATAL] Non-resolvable parent POM if add <relativePath>../pom.xml</relativePath> to POM

hongbofan avatar Jul 31 '22 11:07 hongbofan

That error sounds like an issue with your POM file

Otherwise, make sure paths are relative from the template file. The following work for me: CodeUri: HelloWorldFunction

<project root>
    /template.yaml
    /HelloWorldFunction
        pom.xml

CodeUri: .

<project root>
    /HelloWorldFunction
        pom.xml
        template.yaml

CodeUri: ../

<project root>
    /HelloWorldFunction
        pom.xml
        /src
            template.yaml

rli avatar Aug 02 '22 17:08 rli

Thanks,I have other question I set 1659492471585

and local docker is running. But SAM Build has failed,samcli.local.docker.manager.DockerImagePullFailedException: Could not find amazon/aws-sam-cli-build-imamge-java8:latest image locally and failed to pull it from docker.

hongbofan avatar Aug 03 '22 02:08 hongbofan

There is a typo -- imamge, should be image

rli avatar Aug 03 '22 16:08 rli

There is a typo -- imamge, should be image

I build succeeded but image was not found when invoke function,why it will build new image? B9(B Y`QR@U YRVFOUM$K%L

Build Succeeded

Built Artifacts  : .aws-sam\build
Built Template   : .aws-sam\build\template.yaml
...
Invoking AWSCloudWatchOnceEvery5MinutesLauncher::handleRequest (java8)
Image was not found.
Removing rapid images for repo amazon/aws-sam-cli-build-image-java8
Building image....................
Skip pulling image and use local one: amazon/aws-sam-cli-build-image-java8:rapid-1.53.0-x86_64.

D9}CF`62VGBQRQHKOX8{Y6

hongbofan avatar Aug 04 '22 00:08 hongbofan

That error sounds like an issue with your POM file

Otherwise, make sure paths are relative from the template file. The following work for me: CodeUri: HelloWorldFunction

<project root>
    /template.yaml
    /HelloWorldFunction
        pom.xml

CodeUri: .

<project root>
    /HelloWorldFunction
        pom.xml
        template.yaml

CodeUri: ../

<project root>
    /HelloWorldFunction
        pom.xml
        /src
            template.yaml

If my project is a parent-son maven project,I want to invoke son maven project. It shows "Non-resolvable parent POM if the CodeUri is ../" if the "CodeUri" point to son maven project. It will build all son maven project that not my expectation if the "CodeUri" point to parent maven project.

hongbofan avatar Aug 04 '22 02:08 hongbofan

SAM scopes down the mount to what is specified in the CodeUri.

I don't think there is a way to only build the child project that you are targeting.

rli avatar Aug 04 '22 20:08 rli