Skip to content

Commit 136fe36

Browse files
[MASSEMBLY-1018] Fix examples about useStrictFiltering
1 parent 33d3d94 commit 136fe36

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/site/apt/advanced-descriptor-topics.apt.vm

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Advanced Assembly-Descriptor Topics
229229
[...]
230230
<fileSets>
231231
<fileSet>
232-
<directory>${project.basedir}</directory>
232+
<directory>\${project.basedir}</directory>
233233
<outputDirectory></outputDirectory>
234234
<excludes>
235235
<exclude>%regex[(?!.*src/).*target.*]</exclude>
@@ -252,44 +252,38 @@ Advanced Assembly-Descriptor Topics
252252
At times, you want to build in a set of sanity checks when creating your
253253
assembly, to ensure that what goes into the assembly artifact is what you
254254
intended. One way you can do this is by enabling <<<useStrictFiltering>>> on
255-
your <<<dependencySets>>>, <<<moduleSets>>>, and <<<fileSets>>>.
255+
your <<<dependencySets>>>.
256256

257257
<<<useStrictFiltering>>> is a flag that tells the assembly plugin to track
258258
each include/exclude pattern to make sure it's used during creation of the
259259
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
262262
<<<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
264264
message notifying him of the unused patterns.
265265

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:
271267

272268
+---
273269
<assembly xmlns="http://maven.apache.org/ASSEMBLY/${mdoVersion}"
274270
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
275271
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/${mdoVersion} http://maven.apache.org/xsd/assembly-${mdoVersion}.xsd">
276272
[...]
277-
<fileSets>
278-
<fileSet>
279-
<useStrictFiltering>true</useStrictFiltering>
280-
<outputDirectory>META-INF</outputDirectory>
273+
<dependencySets>
274+
<dependencySet>
281275
<includes>
282-
<include>LICENSE.txt</include>
276+
<include>commons-logging:commons-logging</include>
283277
</includes>
284-
</fileSet>
285-
[...]
286-
</fileSets>
278+
<useStrictFiltering>true</useStrictFiltering>
279+
</dependencySet>
280+
</dependencySets>
287281
[...]
288282
</assembly>
289283
+---
290284

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.
293287

294288
* Using an Alternative Assembly Base Directory
295289

0 commit comments

Comments
 (0)