aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
732 stars 199 forks source link

Maven Lambda debugging should support submodules #3229

Open hongbofan opened 1 year ago

hongbofan commented 1 year ago

Your Environment

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?

rli commented 1 year ago

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

hongbofan commented 1 year ago

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 commented 1 year ago

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 ../pom.xml to POM

hongbofan commented 1 year ago

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 ../pom.xml to POM

rli commented 1 year ago

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
hongbofan commented 1 year ago

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.

rli commented 1 year ago

There is a typo -- imamge, should be image

hongbofan commented 1 year ago

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 commented 1 year ago

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.

rli commented 1 year ago

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.