FunkyJFunctional
FunkyJFunctional copied to clipboard
Maven plugin licence problems
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 ?
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
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
damn xml escaping, when I wrote, "add false to the plugin", in fact I meant :
<inherited>false</inherited>
I realised that adding inherited didn't fix the problem, it disabled the plugin in child modules even when executing from parent module... stupid.