This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch maven-archiver-3.x in repository https://gitbox.apache.org/repos/asf/maven-archiver.git
commit 1ca1bf5c7d1460f770e62e887002179afbb41c0f Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Sat Dec 20 12:37:32 2025 +0100 Convert to MARKDOWN with doxia-converter --- src/site/markdown/examples/classpath.md | 259 ++++++++++--------------- src/site/markdown/examples/manifest.md | 84 ++++---- src/site/markdown/examples/manifestEntries.md | 75 ++++--- src/site/markdown/examples/manifestFile.md | 64 +++--- src/site/markdown/examples/manifestSections.md | 68 +++---- 5 files changed, 234 insertions(+), 316 deletions(-) diff --git a/src/site/markdown/examples/classpath.md b/src/site/markdown/examples/classpath.md index 96a8d2e..68d3032 100644 --- a/src/site/markdown/examples/classpath.md +++ b/src/site/markdown/examples/classpath.md @@ -1,54 +1,46 @@ - ------ - Set Up The Classpath - ------ - Dennis Lundberg - ------ - 2008-01-01 - ------ - - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you under the Apache License, Version 2.0 (the - ~~ "License"); you may not use this file except in compliance - ~~ with the License. You may obtain a copy of the License at - ~~ - ~~ http://www.apache.org/licenses/LICENSE-2.0 - ~~ - ~~ Unless required by applicable law or agreed to in writing, - ~~ software distributed under the License is distributed on an - ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~~ KIND, either express or implied. See the License for the - ~~ specific language governing permissions and limitations - ~~ under the License. - -Set Up The Classpath - -* {Contents} - - * {{{Add}Add A Class-Path Entry To The Manifest}} - - * {{{Make}Make The Jar Executable}} - - * {{{Prefix}Altering The Classpath: Defining a Classpath Directory Prefix}} - - * {{{Repository}Altering The Classpath: Using a Maven Repository-Style Classpath}} - - * {{{Custom}Altering The Classpath: Using a Custom Classpath Format}} - - * {{{Snapshot}Handling Snapshot Versions}} - - [] - -* {Add} A Class-Path Entry To The Manifest - - \[{{{Contents}Top}}\] - - Maven Archiver can add the classpath of your project to the manifest. This is - done with the <<<\<addClasspath\>>>> configuration element. - -+-----+ +--- +title: Set Up The Classpath +author: + - Dennis Lundberg +date: 2008-01-01 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +# Set Up The Classpath + +## <a id="Contents">Contents</a> + +- [Add A Class-Path Entry To The Manifest](#Add) +- [Make The Jar Executable](#Make) +- [Altering The Classpath: Defining a Classpath Directory Prefix](#Prefix) +- [Altering The Classpath: Using a Maven Repository-Style Classpath](#Repository) +- [Altering The Classpath: Using a Custom Classpath Format](#Custom) +- [Handling Snapshot Versions](#Snapshot) + +## <a id="Add">Add A Class-Path Entry To The Manifest</a> + +[[Top](#Contents)] + +Maven Archiver can add the classpath of your project to the manifest. This is done with the `<addClasspath>` configuration element. + +```xml <project> ... <build> @@ -83,29 +75,24 @@ Set Up The Classpath </dependencies> ... </project> -+-----+ +``` - The manifest produced using the above configuration would look like this: +The manifest produced using the above configuration would look like this: -+-----+ +``` Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar -+-----+ - +``` -* {Make} The Jar Executable +## <a id="Make">Make The Jar Executable</a> - \[{{{Contents}Top}}\] +[[Top](#Contents)] - If you want to create an executable jar file, you need to configure Maven - Archiver accordingly. You need to tell it which main class to use. This is - done with the <<<\<mainClass\>>>> configuration element. Here is a sample - <<<pom.xml>>> configured to add the classpath and use the class - <<<fully.qualified.MainClass>>> as the main class: +If you want to create an executable jar file, you need to configure Maven Archiver accordingly. You need to tell it which main class to use. This is done with the `<mainClass>` configuration element. Here is a sample `pom.xml` configured to add the classpath and use the class `fully.qualified.MainClass` as the main class: -+-----+ +```xml <project> ... <build> @@ -141,28 +128,25 @@ Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar </dependencies> ... </project> -+-----+ +``` - The manifest produced using the above configuration would look like this: +The manifest produced using the above configuration would look like this: -+-----+ +``` Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} Main-Class: fully.qualified.MainClass Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar -+-----+ - +``` -* Altering The Classpath: Defining a Classpath Directory {Prefix} +## <a id="Prefix">Altering The Classpath: Defining a Classpath Directory Prefix</a> - \[{{{Contents}Top}}\] +[[Top](#Contents)] - Sometimes it is useful to be able to alter the classpath, for example when - {{{/plugins/maven-war-plugin/examples/skinny-wars.html}creating skinny war-files}}. - This can be achieved with the <<<\<classpathPrefix\>>>> configuration element. +Sometimes it is useful to be able to alter the classpath, for example when [creating skinny war-files](/plugins/maven-war-plugin/examples/skinny-wars.html). This can be achieved with the `<classpathPrefix>` configuration element. -+-----+ +```xml <project> ... <build> @@ -195,26 +179,23 @@ Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar </dependencies> ... </project> -+-----+ +``` - The manifest classpath produced using the above configuration would look like this: +The manifest classpath produced using the above configuration would look like this: -+-----+ +``` Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar -+-----+ +``` -* Altering The Classpath: Using a Maven {Repository}-Style Classpath +## <a id="Repository">Altering The Classpath: Using a Maven Repository-Style Classpath</a> - \[{{{Contents}Top}}\] +[[Top](#Contents)] - <(Since: 2.3, see below)> +_(Since: 2.3, see below)_ - Occasionally, you may want to include a Maven repository-style directory structure in your - archive. If you wish to reference the dependency archives within those directories in your - manifest classpath, try using the <<<\<classpathLayoutType\>>>> element with a value of - <<<'repository'>>>, like this: +Occasionally, you may want to include a Maven repository-style directory structure in your archive. If you wish to reference the dependency archives within those directories in your manifest classpath, try using the `<classpathLayoutType>` element with a value of `'repository'`, like this: -+-----+ +```xml <project> ... <build> @@ -249,26 +230,23 @@ Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar </dependencies> ... </project> -+-----+ +``` - The manifest classpath produced using the above configuration would look like this: +The manifest classpath produced using the above configuration would look like this: -+-----+ +``` Class-Path: lib/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar lib/commons-lang/commons-lang/2.1/commons-lang-2.1.jar -+-----+ +``` -* Altering The Classpath: Using a {Custom} Classpath Format +## <a id="Custom">Altering The Classpath: Using a Custom Classpath Format</a> - \[{{{Contents}Top}}\] +[[Top](#Contents)] - <(Since: 2.4)> +_(Since: 2.4)_ - At times, you may have dependency archives in a custom format within your own archive, one that doesn't - conform to any of the above classpath layouts. If you wish to define a custom layout for dependency archives - within your archive's manifest classpath, try using the <<<\<classpathLayoutType\>>>> element with a value of - <<<'custom'>>>, along with the <<<\<customClasspathLayout\>>>> element, like this: +At times, you may have dependency archives in a custom format within your own archive, one that doesn't conform to any of the above classpath layouts. If you wish to define a custom layout for dependency archives within your archive's manifest classpath, try using the `<classpathLayoutType>` element with a value of `'custom'`, along with the `<customClasspathLayout>` element, like this: -+-----+ +```xml <project> ... <build> @@ -302,80 +280,51 @@ Class-Path: lib/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar lib/co </dependencies> ... </project> -+-----+ - - This classpath layout is a little more involved than the previous examples. - To understand how the value of the <<<\<customClasspathLayout\>>>> configuration - is interpreted, it's useful to understand the rules applied when resolving - expressions within the value: - - [[1]] If present, trim off the prefix 'artifact.' from the expression. - - [[2]] Attempt to resolve the expression as a reference to the Artifact using - reflection (eg. <<<'artifactId'>>> becomes a reference to the method - <<<'getArtifactId()'>>>). +``` - [[3]] Attempt to resolve the expression as a reference to the ArtifactHandler of - the current Artifact, again using reflection (eg. <<<'extension'>>> becomes a reference - to the method <<<'getExtension()'>>>). +This classpath layout is a little more involved than the previous examples. To understand how the value of the `<customClasspathLayout>` configuration is interpreted, it's useful to understand the rules applied when resolving expressions within the value: - [[4]] Attempt to resolve the expression as a key in the special-case Properties instance, - which contains the following mappings: +1. If present, trim off the prefix 'artifact.' from the expression. +1. Attempt to resolve the expression as a reference to the Artifact using reflection (eg. `'artifactId'` becomes a reference to the method `'getArtifactId()'`). +1. Attempt to resolve the expression as a reference to the ArtifactHandler of the current Artifact, again using reflection (eg. `'extension'` becomes a reference to the method `'getExtension()'`). +1. Attempt to resolve the expression as a key in the special-case Properties instance, which contains the following mappings: + - `'dashClassifier'`: If the Artifact has a classifier, this will be `'-$artifact.classifier'`, otherwise this is an empty string. + - `'dashClassifier?'`: This is a synonym of `'dashClassifier'`. + - `'groupIdPath'`: This is the equivalent of `'$artifact.groupId'`, with all `'.'` characters replaced by `'/'`. - * <<<'dashClassifier'>>>: If the Artifact has a classifier, this will be - <<<'-${artifact.classifier}'>>>, otherwise this - is an empty string. +The manifest classpath produced using the above configuration would look like this: - * <<<'dashClassifier?'>>>: This is a synonym of <<<'dashClassifier'>>>. - - * <<<'groupIdPath'>>>: This is the equivalent of <<<'${artifact.groupId}'>>>, - with all <<<'.'>>> characters replaced by <<<'/'>>>. - - [] - - [] - - The manifest classpath produced using the above configuration would look like this: - -+-----+ +``` Class-Path: WEB-INF/lib/org/codehaus/plexus/plexus-utils-1.1.jar WEB-INF/lib/commons-lang/commons-lang-2.1.jar -+-----+ - +``` -* Handling {Snapshot} Versions +## <a id="Snapshot">Handling Snapshot Versions</a> - \[{{{Contents}Top}}\] +[[Top](#Contents)] - <(Since 2.4)> +_(Since 2.4)_ - Depending on how you construct your archive, you may have the ability to specify whether - snapshot dependency archives are included with the version suffix <<<'-SNAPSHOT'>>>, or - whether the unique timestamp and build-number for that archive is used. For instance, - the {{{/plugins/maven-assembly-plugin}Assembly Plugin}} allows - you to make this decision in the <<<\<outputFileNameMapping\>>>> element of its - <<<\<dependencySet>>>> descriptor section. +Depending on how you construct your archive, you may have the ability to specify whether snapshot dependency archives are included with the version suffix `'-SNAPSHOT'`, or whether the unique timestamp and build-number for that archive is used. For instance, the [Assembly Plugin](/plugins/maven-assembly-plugin) allows you to make this decision in the `<outputFileNameMapping>` element of its `<dependencySet`> descriptor section. -** Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout +### Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout - To force the use of <<<'-SNAPSHOT'>>> version naming, simply disable the <<<\<useUniqueVersions\>>>> - configuration element, like this: +To force the use of `'-SNAPSHOT'` version naming, simply disable the `<useUniqueVersions>` configuration element, like this: -+-----+ +```xml <useUniqueVersions>false</useUniqueVersions> -+-----+ +``` -** Forcing the use of -SNAPSHOT versions with custom layouts +### Forcing the use of -SNAPSHOT versions with custom layouts - To force the use of <<<'-SNAPSHOT'>>> version naming, simply replace <<<'${artifact.version}'>>> - with <<<'${artifact.baseVersion}'>>> in the custom layout example above, so it looks like this: +To force the use of `'-SNAPSHOT'` version naming, simply replace `'$artifact.version'` with `'$artifact.baseVersion'` in the custom layout example above, so it looks like this: -+-----+ +```xml <customClasspathLayout>WEB-INF/lib/${artifact.groupIdPath}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</customClasspathLayout> -+-----+ +``` - The full example configuration would look like this: +The full example configuration would look like this: -+-----+ +```xml <project> ... <build> @@ -396,4 +345,4 @@ Class-Path: WEB-INF/lib/org/codehaus/plexus/plexus-utils-1.1.jar WEB-INF/lib/com </build> ... </project> -+-----+ +``` diff --git a/src/site/markdown/examples/manifest.md b/src/site/markdown/examples/manifest.md index ef2f1cd..2939689 100644 --- a/src/site/markdown/examples/manifest.md +++ b/src/site/markdown/examples/manifest.md @@ -1,56 +1,48 @@ - ------ - Manifest - ------ - Dennis Lundberg - ------ - 2008-01-01 - ------ +--- +title: Manifest +author: + - Dennis Lundberg +date: 2008-01-01 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you under the Apache License, Version 2.0 (the - ~~ "License"); you may not use this file except in compliance - ~~ with the License. You may obtain a copy of the License at - ~~ - ~~ http://www.apache.org/licenses/LICENSE-2.0 - ~~ - ~~ Unless required by applicable law or agreed to in writing, - ~~ software distributed under the License is distributed on an - ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~~ KIND, either express or implied. See the License for the - ~~ specific language governing permissions and limitations - ~~ under the License. + http://www.apache.org/licenses/LICENSE-2.0 -Manifest +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +# Manifest -* Default Manifest +## Default Manifest - The default manifest created by Maven Archiver will contain the following - bits of information: +The default manifest created by Maven Archiver will contain the following bits of information: -+-----+ +``` Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} -+-----+ +``` - <<Note:>> The <<<Build-Jdk>>> does not take toolchains configuration into account. It is the same - JDK version as running the Maven instance. +**Note:** The `Build-Jdk` does not take toolchains configuration into account. It is the same JDK version as running the Maven instance. -* Adding Implementation And Specification Details +## Adding Implementation And Specification Details - Starting with version 2.1, Maven Archiver no longer creates the - Implementation and Specification details in the manifest by default. - If you want them in your manifest you have to say so explicitly in your configuration. +Starting with version 2.1, Maven Archiver no longer creates the Implementation and Specification details in the manifest by default. If you want them in your manifest you have to say so explicitly in your configuration. - <<Note:>> Because this is a recent change in Maven Archiver, different plugins - may or may not have started using it yet. Please check the documentation for - the plugin you want to use. In this example we use maven-jar-plugin 2.1 which - was the first version of that plugin to use this new feature. +**Note:** Because this is a recent change in Maven Archiver, different plugins may or may not have started using it yet. Please check the documentation for the plugin you want to use. In this example we use maven-jar-plugin 2.1 which was the first version of that plugin to use this new feature. -+-----+ +```xml <project> ... <build> @@ -74,11 +66,11 @@ Build-Jdk: ${java.version} </build> ... </project> -+-----+ +``` - The resulting manifest would contain these pieces of information: +The resulting manifest would contain these pieces of information: -+-----+ +```properties Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} @@ -88,8 +80,6 @@ Specification-Vendor: ${project.organization.name} Implementation-Title: ${project.name} Implementation-Version: ${project.version} Implementation-Vendor: ${project.organization.name} -+-----+ +``` - <<Note:>> If your pom.xml does not have an <<<\<organization\>>>>/<<<\<name\>>>> - element, then the <<<Specification-Vendor>>> and <<<Implementation-Vendor>>> - entries will <<not>> be in the manifest. +**Note:** If your pom.xml does not have an `<organization>`/`<name>` element, then the `Specification-Vendor` and `Implementation-Vendor` entries will **not** be in the manifest. diff --git a/src/site/markdown/examples/manifestEntries.md b/src/site/markdown/examples/manifestEntries.md index fe28c61..15767e2 100644 --- a/src/site/markdown/examples/manifestEntries.md +++ b/src/site/markdown/examples/manifestEntries.md @@ -1,42 +1,36 @@ - ------ - Manifest Entries - ------ - Dennis Lundberg - ------ - 2008-01-01 - ------ +--- +title: Manifest Entries +author: + - Dennis Lundberg +date: 2008-01-01 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you under the Apache License, Version 2.0 (the - ~~ "License"); you may not use this file except in compliance - ~~ with the License. You may obtain a copy of the License at - ~~ - ~~ http://www.apache.org/licenses/LICENSE-2.0 - ~~ - ~~ Unless required by applicable law or agreed to in writing, - ~~ software distributed under the License is distributed on an - ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~~ KIND, either express or implied. See the License for the - ~~ specific language governing permissions and limitations - ~~ under the License. + http://www.apache.org/licenses/LICENSE-2.0 -Manifest Entries +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +# Manifest Entries - If you find that the other configuration options for Maven Archiver are not - enough for manipulating the manifest, you can add your own entries to it. - This is done with the <<<\<manifestEntries\>>>> configuration element. +If you find that the other configuration options for Maven Archiver are not enough for manipulating the manifest, you can add your own entries to it. This is done with the `<manifestEntries>` configuration element. - In this example we'll add some entries to the manifest by specifying what we'd - like in the <<<\<configuration\>>>>/<<<\<archive\>>>> element of - maven-jar-plugin. +In this example we'll add some entries to the manifest by specifying what we'd like in the `<configuration>`/`<archive>` element of maven-jar-plugin. - <<Note:>> As with all the examples here, this configuration can be used in all - plugins that use Maven Archiver, not just maven-jar-plugin as in this example. +**Note:** As with all the examples here, this configuration can be used in all plugins that use Maven Archiver, not just maven-jar-plugin as in this example. -+-----+ +```xml <project> <url>http://some.url.org/</url> ... @@ -60,20 +54,17 @@ Manifest Entries </build> ... </project> -+-----+ +``` - As you see above you can use literal values or you can have values from the - POM interpolated into literals or simply use straight POM expressions. So this - is what your resultant manifest will look like inside the created jar: +As you see above you can use literal values or you can have values from the POM interpolated into literals or simply use straight POM expressions. So this is what your resultant manifest will look like inside the created jar: -+-----+ +```properties Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} mode: development url: http://some.url.org/ -+-----+ +``` + +**Note:** If your pom.xml does not have the `<url>` element, referenced through interpolation, then the entry `url` will **not** be in the manifest. - <<Note:>> If your pom.xml does not have the <<<\<url\>>>> element, referenced - through interpolation, then the entry <<<url>>> will <<not>> be in the - manifest. diff --git a/src/site/markdown/examples/manifestFile.md b/src/site/markdown/examples/manifestFile.md index 1fcaa53..87f746c 100644 --- a/src/site/markdown/examples/manifestFile.md +++ b/src/site/markdown/examples/manifestFile.md @@ -1,44 +1,36 @@ - ------ - Use Your Own Manifest File - ------ - Dennis Lundberg - ------ - 2008-01-01 - ------ +--- +title: Use Your Own Manifest File +author: + - Dennis Lundberg +date: 2008-01-01 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you under the Apache License, Version 2.0 (the - ~~ "License"); you may not use this file except in compliance - ~~ with the License. You may obtain a copy of the License at - ~~ - ~~ http://www.apache.org/licenses/LICENSE-2.0 - ~~ - ~~ Unless required by applicable law or agreed to in writing, - ~~ software distributed under the License is distributed on an - ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~~ KIND, either express or implied. See the License for the - ~~ specific language governing permissions and limitations - ~~ under the License. + http://www.apache.org/licenses/LICENSE-2.0 -Use Your Own Manifest File +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +# Use Your Own Manifest File - By default, Maven Archiver creates the manifest file for you. It is - sometimes useful to use your own hand crafted manifest file. Say that you - want to use the manifest file <<<src/main/resources/META-INF/MANIFEST.MF>>>. - This is done with the <<<\<manifestFile\>>>> configuration element by setting - the value to the location of your file. +By default, Maven Archiver creates the manifest file for you. It is sometimes useful to use your own hand crafted manifest file. Say that you want to use the manifest file `src/main/resources/META-INF/MANIFEST.MF`. This is done with the `<manifestFile>` configuration element by setting the value to the location of your file. - The content of your own manifest file will be merged with the entries - created by Maven Archiver. If you specify an entry in your own manifest file - it will override the value created by Maven Archiver. +The content of your own manifest file will be merged with the entries created by Maven Archiver. If you specify an entry in your own manifest file it will override the value created by Maven Archiver. - <<Note:>> As with all the examples here, this configuration can be used in all - plugins that use Maven Archiver, not just maven-jar-plugin as in this example. +**Note:** As with all the examples here, this configuration can be used in all plugins that use Maven Archiver, not just maven-jar-plugin as in this example. -+-----+ +```xml <project> ... <build> @@ -58,4 +50,4 @@ Use Your Own Manifest File </build> ... </project> -+-----+ +``` diff --git a/src/site/markdown/examples/manifestSections.md b/src/site/markdown/examples/manifestSections.md index 0f335d6..3179b15 100644 --- a/src/site/markdown/examples/manifestSections.md +++ b/src/site/markdown/examples/manifestSections.md @@ -1,41 +1,37 @@ - ------ - Manifest Sections - ------ - Olivier Lamy - Dennis Lundberg - ------ - 2008-01-01 - ------ +--- +title: Manifest Sections +author: + - Olivier Lamy + - Dennis Lundberg +date: 2008-01-01 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you under the Apache License, Version 2.0 (the - ~~ "License"); you may not use this file except in compliance - ~~ with the License. You may obtain a copy of the License at - ~~ - ~~ http://www.apache.org/licenses/LICENSE-2.0 - ~~ - ~~ Unless required by applicable law or agreed to in writing, - ~~ software distributed under the License is distributed on an - ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~~ KIND, either express or implied. See the License for the - ~~ specific language governing permissions and limitations - ~~ under the License. + http://www.apache.org/licenses/LICENSE-2.0 -Manifest Sections +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +# Manifest Sections - The <<<\<manifestSections\>>>> element provides a way to add custom manifest - sections. It contains a list of - <<<\<{{{../index.html#class_manifestSection}manifestSection}}\>>>> elements. +The `<manifestSections>` element provides a way to add custom manifest sections. It contains a list of [`<manifestSection>`](../index.html#class_manifestSection) elements. - <<Note:>> As with all the examples here, this configuration can be used in all - plugins that use Maven Archiver, not just maven-jar-plugin as in this example. +**Note:** As with all the examples here, this configuration can be used in all plugins that use Maven Archiver, not just maven-jar-plugin as in this example. - Given this configuration: +Given this configuration: -+-----+ +```xml <project> ... <build> @@ -68,11 +64,11 @@ Manifest Sections </build> ... </project> -+-----+ +``` - The following content will end up in the manifest: +The following content will end up in the manifest: -+-----+ +``` Manifest-Version: 1.0 Created-By: Apache Maven ${maven.version} Build-Jdk: ${java.version} @@ -82,4 +78,4 @@ id: nice foo Name: bar id: nice bar -+-----+ +```
