I want to create multiple jars in one maven project. The number of jars that would be generated is not known explicitly. It depends on the number of some packages.
I found how to create a jar with maven-jar-plugin
based on explicity pointed package
<configuration>
<includes>
<include>com/processor/plugin/**</include>
</includes>
</configuration>
But in my case, the names of packages under com.processor.plugin
are not known.
XProcessor and XProcessorProvider form a jar.
| com
| processor
| plugin
| first
| FirstProcessor.java
| FirstProcessorProvider.java
| second
| SecondProcessor.java
| SecondProcessorPorvider.java
| third
| ThirdProcessor.java
| ThirdProcessorProvider.java
Expected result of mvn package
:
first.jar, second.jar, third.jar
Is it possible at all?
What is the cause of these maybe strange requirements?
I'm going to use ServiceLoader which requires jar(s) with META-INF/service/ProcessorProvider
file. But this would be solved with http://metainf-services.kohsuke.org/