elasticsearch - Maven Shade - change file name and replace text -
i trying use maven shade , wrap elasticsearch jar.
the reason, why doing because have conflict between lucene version in project.
but found problem, when using shade. doesn't change name of file in meta-inf/services
, doesn't change fqn in particular files.
i need change org.apache.lucene.codecs.codec
file , content. because if file keep name, error
"caused by: java.lang.illegalargumentexception: spi class of type shaded_lucene_4_10_4.org.apache.lucene.codecs.codec name 'lucene410' not exist. need add corresponding jar file supporting spi classpath. current classpath supports following names: []"
is possible wrap elasticsearch maven shade plugin?
yes possible, need add servicesresourcetransformer entry. this:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.4.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.manifestresourcetransformer"> <mainclass>org.myorg.esclient.app</mainclass> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.servicesresourcetransformer"/> </transformers> </configuration> </execution> </executions> </plugin>
Comments
Post a Comment