Skip to content

Commit 19058b4

Browse files
fix: update samples/snippets pom.xml configuration to avoid fat jar (#2100)
* fix: update samples/snippets pom.xml configuration to avoid fat jar * fix: refactor path of jar creation and remove assembly-descriptor.xml file * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 028505b commit 19058b4

File tree

2 files changed

+46
-42
lines changed

2 files changed

+46
-42
lines changed

samples/snippets/assembly-descriptor.xml

-27
This file was deleted.

samples/snippets/pom.xml

+46-15
Original file line numberDiff line numberDiff line change
@@ -115,30 +115,61 @@
115115
</dependency>
116116
</dependencies>
117117
<build>
118-
<finalName>spanner-google-cloud-samples</finalName>
119118
<plugins>
120119
<plugin>
121-
<artifactId>maven-assembly-plugin</artifactId>
122-
<version>3.4.2</version>
120+
<artifactId>maven-resources-plugin</artifactId>
121+
<executions>
122+
<execution>
123+
<id>copy-resources</id>
124+
<phase>validate</phase>
125+
<goals>
126+
<goal>copy-resources</goal>
127+
</goals>
128+
<configuration>
129+
<outputDirectory>${project.build.directory}/spanner-snippets</outputDirectory>
130+
<resources>
131+
<resource>
132+
<directory>resources</directory>
133+
<filtering>true</filtering>
134+
</resource>
135+
</resources>
136+
</configuration>
137+
</execution>
138+
</executions>
139+
</plugin>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-dependency-plugin</artifactId>
143+
<executions>
144+
<execution>
145+
<id>copy-dependencies</id>
146+
<phase>prepare-package</phase>
147+
<goals>
148+
<goal>copy-dependencies</goal>
149+
</goals>
150+
<configuration>
151+
<outputDirectory>${project.build.directory}/spanner-snippets/lib</outputDirectory>
152+
<overWriteReleases>false</overWriteReleases>
153+
<overWriteSnapshots>false</overWriteSnapshots>
154+
<overWriteIfNewer>true</overWriteIfNewer>
155+
</configuration>
156+
</execution>
157+
</executions>
158+
</plugin>
159+
<plugin>
160+
<groupId>org.apache.maven.plugins</groupId>
161+
<artifactId>maven-jar-plugin</artifactId>
123162
<configuration>
124-
<descriptors>
125-
<descriptor>assembly-descriptor.xml</descriptor>
126-
</descriptors>
163+
<finalName>spanner-snippets/spanner-google-cloud-samples</finalName>
127164
<archive>
165+
<index>false</index>
128166
<manifest>
129167
<mainClass>com.example.spanner.SpannerSample</mainClass>
168+
<addClasspath>true</addClasspath>
169+
<classpathPrefix>lib/</classpathPrefix>
130170
</manifest>
131171
</archive>
132172
</configuration>
133-
<executions>
134-
<execution>
135-
<id>make-assembly</id>
136-
<phase>package</phase>
137-
<goals>
138-
<goal>single</goal>
139-
</goals>
140-
</execution>
141-
</executions>
142173
</plugin>
143174
<plugin>
144175
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)