|
16 | 16 | */ |
17 | 17 | package org.apache.logging.log4j; |
18 | 18 |
|
19 | | -/* |
20 | | - * Copyright 2001-2005 The Apache Software Foundation. |
21 | | - * |
22 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
23 | | - * you may not use this file except in compliance with the License. |
24 | | - * You may obtain a copy of the License at |
25 | | - * |
26 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
27 | | - * |
28 | | - * Unless required by applicable law or agreed to in writing, software |
29 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
30 | | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
31 | | - * See the License for the specific language governing permissions and |
32 | | - * limitations under the License. |
33 | | - */ |
34 | | - |
35 | 19 | import java.io.File; |
36 | 20 |
|
37 | 21 | import org.apache.logging.log4j.changelog.exporter.ChangelogExporter; |
38 | 22 | import org.apache.logging.log4j.changelog.exporter.ChangelogExporterArgs; |
39 | 23 |
|
40 | 24 | import org.apache.maven.plugin.AbstractMojo; |
41 | | -import org.apache.maven.plugin.MojoExecutionException; |
42 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; |
43 | 26 | import org.apache.maven.plugins.annotations.Mojo; |
44 | 27 | import org.apache.maven.plugins.annotations.Parameter; |
45 | 28 |
|
46 | 29 | /** |
47 | | - * Goal which creates a changelog. |
| 30 | + * Goal exporting the changelog directory. |
| 31 | + * |
| 32 | + * @see ChangelogExporter |
48 | 33 | */ |
49 | 34 | @Mojo(name = "export", defaultPhase = LifecyclePhase.PRE_SITE) |
50 | 35 | public class ExportMojo extends AbstractMojo { |
| 36 | + |
51 | 37 | /** |
52 | | - * Location of the file. |
| 38 | + * Directory containing release folders composed of changelog entry XML files. |
53 | 39 | */ |
54 | | - @Parameter(defaultValue = "${project.build.directory}/generated-sources/site/asciidoc/changelog", |
55 | | - property = "outputDir", required = true) |
56 | | - private File outputDirectory; |
| 40 | + @Parameter( |
| 41 | + defaultValue = "${project.basedir}/src/changelog", |
| 42 | + property = ChangelogExporterArgs.CHANGELOG_DIRECTORY_PROPERTY_NAME, |
| 43 | + required = true) |
| 44 | + private File changelogDirectory; |
57 | 45 |
|
58 | 46 | /** |
59 | | - * Location of the file. |
| 47 | + * Directory to write generated changelog files. |
60 | 48 | */ |
61 | | - @Parameter(defaultValue = "${project.basedir}/src/changelog", property = "changeLogDir", required = true) |
62 | | - private File changeLogDirectory; |
| 49 | + @Parameter( |
| 50 | + defaultValue = "${project.build.directory}/generated-sources/site/asciidoc/changelog", |
| 51 | + property = ChangelogExporterArgs.OUTPUT_DIRECTORY_PROPERTY_NAME, |
| 52 | + required = true) |
| 53 | + private File outputDirectory; |
63 | 54 |
|
64 | | - public void execute() throws MojoExecutionException { |
65 | | - ChangelogExporter.performExport(ChangelogExporterArgs.fromArgs(changeLogDirectory.toPath(), |
66 | | - outputDirectory.toPath())); |
| 55 | + public void execute() { |
| 56 | + ChangelogExporterArgs args = ChangelogExporterArgs.fromArgs( |
| 57 | + changelogDirectory.toPath(), |
| 58 | + outputDirectory.toPath()); |
| 59 | + ChangelogExporter.performExport(args); |
67 | 60 | } |
| 61 | + |
68 | 62 | } |
0 commit comments