FunkyJFunctional icon indicating copy to clipboard operation
FunkyJFunctional copied to clipboard

Maven plugin licence problems

Open nfrancois opened this issue 13 years ago • 3 comments

The sub-modules build fail because header files from parent is not found.

ex :

[ERROR] Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check (default) on project funkyjfunctional-core: Resource /Users/Nicolas/Dev/sources/nfrancois/FunkyJFunctional/funkyjfunctional-core/src/etc/header.txt not found in file system, classpath or URL: no protocol: /Users/Nicolas/Dev/sources/nfrancois/FunkyJFunctional/funkyjfunctional-core/src/etc/header.txt -> [Help 1]

I found 2 solutions :

  • very naive solution : add it in all resources submodules.
  • set header files values to ${root.dir}/src/etc/header.txt and set root.dir to ${basedir} in parent pom and ${parent.relativePath} in sub-modules poms (ie overriding root.dir value).

Another idea ?

nfrancois avatar May 13 '11 19:05 nfrancois

You are totally right, this is quite a problem (although I always build from the parent pom).

I guess it's a bug in the license plugin...

Your solutions are pretty good, but sound a bit like hacks :-) .

We have another solution : add false to the plugin, so that it only works from the parent project.

It is already filed as a bug in the license plugin : http://code.google.com/p/maven-license-plugin/issues/detail?id=52

There is also another solution here : http://code.google.com/p/maven-license-plugin/issues/detail?id=52#c3 => basically, put the header in a jar, and add the jar as a dependency.

For now, I will only add false (fast & simple fix), but if you come up with a better solution, I'll be glad to merge it ;-) .

pyricau avatar May 18 '11 13:05 pyricau

damn xml escaping, when I wrote, "add false to the plugin", in fact I meant :

<inherited>false</inherited>

pyricau avatar May 18 '11 13:05 pyricau

I realised that adding inherited didn't fix the problem, it disabled the plugin in child modules even when executing from parent module... stupid.

pyricau avatar May 28 '11 16:05 pyricau