On the sony binding, I have a webapp that works fine. However, the default maven build task will include all the develop jars (and especially node_modules) in the final target build.
I am not a maven guru in the least bit - how do I tell maven (via my child pom.xml) to exclude certain directories from the final jar?
The WAR packaging of Maven projects is controlled through maven-war-plugin.
If your dependencies are not required to be embedded in final WAR mark it with <scope>provided</scope>. It might be also a good idea to create a separate module where only nodejs stuff will be packaged and linked through webResources in plugin configuration.
Ok - alot of what you said went ‘whoosh’ above my head But after googline, here is my structure and below and what I tried (unsuccessfully) to exclude:
Thanks for reply Tim, indeed I misread your first post. You wrote that you have “webapp” which I translated into maven-war-plugin. Sorry about that. After checking output I figured out you have a standard ESH/openHAB binding, which means there is no WAR at all, I should have been asked about how you build the whole thing.
From the output it is clear that you have maven-jar-plugin. You can try to use a few things
Above ways are slightly different. The main difference between 2nd and 3rd is that build helper allows you to link a couple of plugins into a pipeline where one generates resources by ie. unpacking some archive and then dynamically bind it.
The includes/excludes in the first case is the simplest one. You can try to run Maven build with -X option to enable verbose output to see how your rules are applied to JAR contents.
Be aware that JAR might be still post-processed by bnd to generate an OSGi manifest.
Thanks - the “-X” helped me immensely. Below is the final solution (I had to hit both the maven-jar-plugin to exclude the source/node_modules directories and the maven-source-plugin to ignore the node_modules directory). Note: the last step is what compile the web app…