@@ -229,7 +229,7 @@ Advanced Assembly-Descriptor Topics
229
229
[...]
230
230
<fileSets>
231
231
<fileSet>
232
- <directory>${project.basedir}</directory>
232
+ <directory>\ ${project.basedir}</directory>
233
233
<outputDirectory></outputDirectory>
234
234
<excludes>
235
235
<exclude>%regex[(?!.*src/).*target.*]</exclude>
@@ -252,44 +252,38 @@ Advanced Assembly-Descriptor Topics
252
252
At times, you want to build in a set of sanity checks when creating your
253
253
assembly, to ensure that what goes into the assembly artifact is what you
254
254
intended. One way you can do this is by enabling <<<useStrictFiltering>>> on
255
- your <<<dependencySets>>>, <<<moduleSets>>>, and <<<fileSets>>> .
255
+ your <<<dependencySets>>>.
256
256
257
257
<<<useStrictFiltering>>> is a flag that tells the assembly plugin to track
258
258
each include/exclude pattern to make sure it's used during creation of the
259
259
assembly. This way, if the assembly-descriptor author intended for a particular
260
- file or artifact to be present, he can add an include/exclude pattern to the
261
- descriptor to ensure that file/ artifact is present, and then set the
260
+ artifact to be present, he can add an include/exclude pattern to the
261
+ descriptor to ensure that artifact is present, and then set the
262
262
<<<useStrictFiltering>>> flag. If the pattern isn't used to match at least one
263
- file during assembly creation, the build will fail and the user will receive a
263
+ artifact during assembly creation, the build will fail and the user will receive a
264
264
message notifying him of the unused patterns.
265
265
266
- ** Example: Ensuring the LICENSE.txt file is included in a jar
267
-
268
- In this example, we want to make sure that our project jar contains the
269
- project's open source license language, in order to be compliant with our
270
- software foundation's policies.
266
+ ** Example:
271
267
272
268
+---
273
269
<assembly xmlns="http://maven.apache.org/ASSEMBLY/${mdoVersion}"
274
270
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
275
271
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/${mdoVersion} http://maven.apache.org/xsd/assembly-${mdoVersion}.xsd">
276
272
[...]
277
- <fileSets>
278
- <fileSet>
279
- <useStrictFiltering>true</useStrictFiltering>
280
- <outputDirectory>META-INF</outputDirectory>
273
+ <dependencySets>
274
+ <dependencySet>
281
275
<includes>
282
- <include>LICENSE.txt </include>
276
+ <include>commons-logging:commons-logging </include>
283
277
</includes>
284
- </fileSet >
285
- [...]
286
- </fileSets >
278
+ <useStrictFiltering>true</useStrictFiltering >
279
+ </dependencySet>
280
+ </dependencySets >
287
281
[...]
288
282
</assembly>
289
283
+---
290
284
291
- If a developer inadvertently removes the LICENSE.txt from the project
292
- directory, the assembly plugin should refuse to build this assembly.
285
+ If <<commons-logging>> artifact will not present on the project dependencies list,
286
+ the assembly plugin should refuse to build this assembly.
293
287
294
288
* Using an Alternative Assembly Base Directory
295
289
0 commit comments