SAM is not compatible with license-maven-plugin-git

Open
#176 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, python
Domain
build-system

Research direction

Start with aws_lambda_builders/workflows/java_maven/workflow.py, especially the EXCLUDED_FILES setting referenced in the issue. Reproduce the failure with a Java project using license-maven-plugin-git and sam build, then determine which proposed configuration allows the build to complete. Done means the project builds with sam build while the plugin can access the required Git metadata.

Written by the indexing model from the issue text.

Description

maintainer/need-response type/feature

Description:

In my company, we have to use license-maven-plugin-git to check for a company header in all files (it's a company mandate).

Since java workflow is excluding .git (here) when copying it to scratch dir, sam build is failing, because it fails to check for files header.

[INFO] --- license-maven-plugin:3.0:check (default) @ my-lambdas ---
[INFO] Checking licenses...
[WARNING] failure occured while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
java.lang.RuntimeException: Could not compute the year of the last git commit for file mylambda.java
    at com.mycila.maven.plugin.license.git.CopyrightRang[WARNING] failure occured while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider

I think we can have at least two approaches to fix:

  1. Be able to override EXCLUDED_FILES value to allow .git on java workflow
  2. Be able to append custom maven parameters, then I can do -Dlicense.skip=true and use another build command to validate license header.

I do prefer option 1, since I may have only one build command.

Steps to reproduce the issue:

  1. Configure a java project with license-maven-plugin-git
  2. Try to build it using sam build

Observed result:
sam build is failing since license-maven-plugin-git is unable to get git year.

Expected result:
Be able to build a project using license-maven-plugin-gitby using onlysam build`

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  • java8
  • maven 3.6.2
Dominant language
Python
Stars
381
Forks
162
Avg merge
1d 1h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-builders

All issues in aws/aws-lambda-builders

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.