mathieucarbou / license-maven-plugin

Manage license headers in your source files

Home Page:https://oss.carbou.me/license-maven-plugin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting DefaultBaseDir to a directory that may not exist fails the plugin

pipelineRat opened this issue · comments

Setting DefaultBaseDir to a directory that may not exist causes the plugin to fail.

I have a controlled parent pom that several projects inherit from.
I have configured the plugin DefaultBaseDir to "${project.basedir}/src" or even "${project.build.sourceDirectory}.

Most projects are multi-module.
Often with the top level module not having a source directory.

Because this directory does not exit the plugin outright fails.

I believe a better behavior would be that the plugin checks if the defaultBaseDir exists first, and skips if the directory does not exist.

Thanks for the report. I will have a look.
You are also welcomed to send a PR if you can.

I thought about the use case...

The defaultBaseDir is a property that has to be set because it determines from where the plugin will execute itself. When it is resolved, it means its execution is required. defaultBaseDir is also used to derive the license baseDir in case a module has multiple licenses.

In other words, when the license plugin execution is wanted, defaultBaseDir is required and must be valid.

In modules where the plugin execution is NOT wanted, it should be skipped. Maven has a way to do that by binding the plugin phase to none, or it is possible to use the plugin property skip to skip it.

commented

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.