Skip to content

Commit 7f69cc6

Browse files
authored
TIKA-4709: avoid shading grpc (#2745)
1 parent c960d38 commit 7f69cc6

2 files changed

Lines changed: 87 additions & 54 deletions

File tree

tika-grpc/pom.xml

Lines changed: 36 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,20 @@
264264
<groupId>org.apache.maven.plugins</groupId>
265265
<artifactId>maven-dependency-plugin</artifactId>
266266
<executions>
267+
<execution>
268+
<id>copy-dependencies</id>
269+
<phase>package</phase>
270+
<goals>
271+
<goal>copy-dependencies</goal>
272+
</goals>
273+
<configuration>
274+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
275+
<includeScope>runtime</includeScope>
276+
<stripVersion>false</stripVersion>
277+
<overWriteReleases>false</overWriteReleases>
278+
<overWriteSnapshots>false</overWriteSnapshots>
279+
</configuration>
280+
</execution>
267281
<execution>
268282
<id>copy-plugins</id>
269283
<phase>process-test-resources</phase>
@@ -452,65 +466,33 @@
452466
</configuration>
453467
</plugin>
454468
<plugin>
455-
<artifactId>maven-shade-plugin</artifactId>
456-
<version>${maven.shade.version}</version>
469+
<groupId>org.apache.maven.plugins</groupId>
470+
<artifactId>maven-jar-plugin</artifactId>
471+
<configuration>
472+
<archive>
473+
<manifest>
474+
<mainClass>org.apache.tika.pipes.grpc.TikaGrpcServer</mainClass>
475+
<addClasspath>true</addClasspath>
476+
<classpathPrefix>lib/</classpathPrefix>
477+
</manifest>
478+
</archive>
479+
</configuration>
480+
</plugin>
481+
<plugin>
482+
<artifactId>maven-assembly-plugin</artifactId>
483+
<configuration>
484+
<descriptors>
485+
<descriptor>src/main/assembly/assembly.xml</descriptor>
486+
</descriptors>
487+
<appendAssemblyId>false</appendAssemblyId>
488+
</configuration>
457489
<executions>
458490
<execution>
491+
<id>make-assembly</id>
459492
<phase>package</phase>
460493
<goals>
461-
<goal>shade</goal>
494+
<goal>single</goal>
462495
</goals>
463-
<configuration>
464-
<createDependencyReducedPom>
465-
false
466-
</createDependencyReducedPom>
467-
<artifactSet>
468-
<excludes>
469-
</excludes>
470-
</artifactSet>
471-
<filters>
472-
<filter>
473-
<artifact>*:*</artifact>
474-
<excludes>
475-
<exclude>module-info.class</exclude>
476-
<exclude>META-INF/maven/plugin.xml</exclude>
477-
<exclude>META-INF/versions/9/module-info.class</exclude>
478-
<exclude>META-INF/*.SF</exclude>
479-
<exclude>META-INF/*.DSA</exclude>
480-
<exclude>META-INF/*.RSA</exclude>
481-
<exclude>META-INF/*.txt</exclude>
482-
<exclude>META-INF/ASL2.0</exclude>
483-
<exclude>META-INF/DEPENDENCIES</exclude>
484-
<exclude>META-INF/LICENSE</exclude>
485-
<exclude>META-INF/NOTICE</exclude>
486-
<exclude>META-INF/README</exclude>
487-
<exclude>META-INF/MANIFEST.MF</exclude>
488-
<exclude>LICENSE.txt</exclude>
489-
<exclude>NOTICE.txt</exclude>
490-
<exclude>CHANGES</exclude>
491-
<exclude>README</exclude>
492-
<exclude>builddef.lst</exclude>
493-
</excludes>
494-
</filter>
495-
</filters>
496-
<transformers>
497-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
498-
<mainClass>org.apache.tika.pipes.grpc.TikaGrpcServer</mainClass>
499-
<manifestEntries>
500-
<Multi-Release>true</Multi-Release>
501-
</manifestEntries>
502-
</transformer>
503-
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
504-
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
505-
<resource>META-INF/LICENSE</resource>
506-
<file>target/classes/META-INF/LICENSE</file>
507-
</transformer>
508-
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
509-
<resource>META-INF/NOTICE</resource>
510-
<file>target/classes/META-INF/NOTICE</file>
511-
</transformer>
512-
</transformers>
513-
</configuration>
514496
</execution>
515497
</executions>
516498
</plugin>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 http://maven.apache.org/xsd/assembly-2.1.1.xsd">
20+
<id>bin</id>
21+
<formats>
22+
<format>zip</format>
23+
</formats>
24+
<includeBaseDirectory>false</includeBaseDirectory>
25+
26+
<dependencySets>
27+
<dependencySet>
28+
<outputDirectory>lib</outputDirectory>
29+
<useProjectArtifact>false</useProjectArtifact>
30+
<unpack>false</unpack>
31+
<scope>runtime</scope>
32+
</dependencySet>
33+
</dependencySets>
34+
<fileSets>
35+
<fileSet>
36+
<directory>${project.build.directory}</directory>
37+
<outputDirectory>/</outputDirectory>
38+
<includes>
39+
<include>*.jar</include>
40+
</includes>
41+
<excludes>
42+
<exclude>*-sources.jar</exclude>
43+
<exclude>*-javadoc.jar</exclude>
44+
</excludes>
45+
</fileSet>
46+
<fileSet>
47+
<directory>${project.build.directory}/plugins</directory>
48+
<outputDirectory>plugins</outputDirectory>
49+
</fileSet>
50+
</fileSets>
51+
</assembly>

0 commit comments

Comments
 (0)