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?

here pom.xml

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> 

check: http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#servicesresourcetransformer


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -