|
| 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 | + https://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 | +
|
| 18 | +This project ships a Maven plugin providing convenient access to the `ChangelogExporter` and `ChangelogReleaser` of xref:../log4j-changelog/README.adoc[log4j-changelog]. |
| 19 | +
|
| 20 | +== Exporting changelogs to AsciiDoc files |
| 21 | +
|
| 22 | +You can use the `export` goal wrapping xref:../log4j-changelog/README.adoc#qa-generate[`ChangelogExporter` to generate AsciiDoc files from a changelog directory]. |
| 23 | +An example usage is shared below. |
| 24 | +
|
| 25 | +.`pom.xml` snippet that goes into the `project > build > plugins` block |
| 26 | +[source,xml] |
| 27 | +---- |
| 28 | +<!-- export AsciiDoc-formatted sources to `target/generated-sources/site/asciidoc/changelog` --> |
| 29 | +<plugin> |
| 30 | + <groupId>org.apache.logging.log4j</groupId> |
| 31 | + <artifactId>log4j-changelog-maven-plugin</artifactId> |
| 32 | + <inherited>false</inherited> |
| 33 | + <executions> |
| 34 | + <execution> |
| 35 | + <id>generate-changelog</id> |
| 36 | + <goals> |
| 37 | + <goal>export</goal> |
| 38 | + </goals> |
| 39 | + </execution> |
| 40 | + </executions> |
| 41 | +</plugin> |
| 42 | +---- |
| 43 | +
|
| 44 | +`export` goal by defaults runs during the `pre-site` phase and accepts the following configuration parameters: |
| 45 | +
|
| 46 | +`changelogDirectory`:: |
| 47 | +Directory containing release folders composed of changelog entry XML files. |
| 48 | +It defaults to `${project.basedir}/src/changelog` and can be set using the `log4j.changelog.directory` property. |
| 49 | +
|
| 50 | +`outputDirectory`:: |
| 51 | +Directory to write generated changelog files. |
| 52 | +It defaults to `${project.build.directory}/generated-sources/site/asciidoc/changelog` and can be set using the `log4j.changelog.exporter.outputDirectory` property. |
| 53 | +
|
| 54 | +== Populating a release changelog directory |
| 55 | +
|
| 56 | +You can use the `release` goal wrapping xref:../log4j-changelog/README.adoc#qa-deploy-release[`ChangelogReleaser` to populate a release changelog directory]. |
| 57 | +An example usage is shared below. |
| 58 | +
|
| 59 | +[source,bash] |
| 60 | +---- |
| 61 | +# Populate `src/changelog/<releaseVersion>` from `src/changelog/.<releaseVersionMajor>.x.x` |
| 62 | +./mvnw -N log4j-changelog:releaser -Dlog4j.changelog.releaseVersion=2.19.0 |
| 63 | +---- |
| 64 | +
|
| 65 | +`release` goal by defaults runs during the `validate` phase and accepts the following configuration parameters: |
| 66 | +
|
| 67 | +`changelogDirectory`:: |
| 68 | +Directory containing release folders composed of changelog entry XML files. |
| 69 | +It defaults to `${project.basedir}/src/changelog` and can be set using the `log4j.changelog.directory` property. |
| 70 | +
|
| 71 | +`releaseVersion`:: |
| 72 | +The version to be released. |
| 73 | +It can be set using the `log4j.changelog.releaseVersion` property. |
0 commit comments