apache / accumulo-testing

Apache Accumulo Testing
https://accumulo.apache.org
Apache License 2.0
15 stars 40 forks source link

Build stopped by files with unapproved licenses #250

Open DomGarguilo opened 2 years ago

DomGarguilo commented 2 years ago

Trying to run mvn clean verify results in a build failure due to:

[WARNING] Files with unapproved licenses:
  contrib/terraform-testing-infrastructure/modules/config-files/conf/hadoop_bashrc
  contrib/terraform-testing-infrastructure/modules/config-files/conf/hosts
  contrib/terraform-testing-infrastructure/modules/config-files/conf/genders
  contrib/terraform-testing-infrastructure/modules/config-files/conf/hadoop_bash_profile

These are sources generated from using Terraform and I have to manually delete them before being able to run verify.

dlmarion commented 2 years ago

I believe the conf directory used to be in .gitignore. check that file and it's history

DomGarguilo commented 2 years ago

I believe the conf directory used to be in .gitignore. check that file and it's history

It is in the .gitignore (contrib/terraform-testing-infrastructure/.gitignore) but the error that im seeing comes from the apache-rat-plugin. There is probably a way to have contrib/terraform-testing-infrastructure/modules/config-files/conf/ ignored by the plugin too.

ctubbsii commented 2 years ago

Generated files for maven builds should be in the target/ directory, or elsewhere outside the source tree for most Maven plugins to ignore them. apache-rat-plugin won't automatically ignore them simply because they're in a folder's .gitignore, since it doesn't read those files There's no reason for apache-rat-plugin to expect you to be running in a git clone, regardless of whether it sees a .gitignore file or not, or to know that .gitignore'd files aren't going to be included in whatever assembly is being prepared but whether or not they are ignored by the SCM. Rat's job is to check for improperly licensed files anywhere in the source tree.

We can add ignore rules for these, but really, generated files shouldn't be polluting the source tree in the first place. We used to do that with a lib directory in the main accumulo repo's source tree, and it caused all sorts of problems. We finally stopped doing that, and now put all generated stuff (that we don't check in) in the target directories.

One way this can be solved is by, instead of relying on .gitignore, just copy it to another directory and run terraform there. This copy-and-run-elsewhere behavior could even be scripted for convenience.