aws-cloudformation / aws-cloudformation/cloudformation-cli-java-plugin

Incorrect CodeUri for sam build

未關閉
#272 0 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Java
星號
30
分支
48
PR 合併指標
30 天內沒有已合併 PR

描述

https://github.com/aws-cloudformation/cloudformation-cli-java-plugin/blob/10e32d7b60f2395650900022e7d5e161481f5136/python/rpdk/java/codegen.py#L49

This `CodeUri` may be correct for other SAM commands, but if you run `sam build` it's incorrect. See https://github.com/awslabs/aws-sam-cli/issues/1278#issuecomment-512341533:

> It looks like your CodeUri is a jar? It should be the directory of your source not the compiled artifact.

The error it gives:

```
Build Failed - Error: JavaMavenWorkflow:CopySource - [Errno 20] Not a directory: '/usr/aws-logs-loggroup/target/aws-logs-loggroup-handler-1.0-SNAPSHOT.jar
```

I fixed it by manually changing the template file:

`CodeUri: ./target/aws-logs-loggroup-handler-1.0-SNAPSHOT.jar`

to

`CodeUri: .`

貢獻指南

開啟貢獻指南

研究方向

Start at python/rpdk/java/codegen.py#L49 and inspect how the generated template sets CodeUri. Run sam build against a generated Java project to reproduce the Not a directory error; done means the template uses the source directory and sam build completes successfully.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
aws, java, python
領域
build-system, cloud
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。