Skip to content

Commit 6f86aae

Browse files
committedNov 17, 2015
MediaWiki support, using lib 1.2
1 parent 5d07983 commit 6f86aae

File tree

6 files changed

+56
-6
lines changed

6 files changed

+56
-6
lines changed
 

‎CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ Changelog of Git Changelog.
55
## Next release
66
### Other changes
77

8+
MediaWiki support, using lib 1.2
9+
10+
doc
11+
12+
## git-changelog-maven-plugin-1.0
13+
### Other changes
14+
815
doc
916

1017
Initial

‎README.md

+8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ Here is and example that will generate a CHANGELOG.md. There is also a running e
2424
<toRef>refs/heads/master</toRef>
2525
<templateFile>changelog.mustache</templateFile>
2626
<settingsFile>changelog.json</settingsFile>
27+
28+
<!-- A file on filesystem //-->
2729
<filePath>CHANGELOG.md</filePath>
30+
31+
<!-- Or post to MediaWiki //-->
32+
<mediaWikiUsername>tomas</mediaWikiUsername>
33+
<mediaWikiPassword>tomaskod</mediaWikiPassword>
34+
<mediaWikiUrl>http://localhost/mediawiki</mediaWikiUrl>
35+
<mediaWikiTitle>Tomas Title</mediaWikiTitle>
2836
</configuration>
2937
</execution>
3038
</executions>

‎git-changelog-maven-plugin-example/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ Changelog of Git Changelog.
55
## Next release
66
### Other changes
77

8+
MediaWiki support, using lib 1.2
9+
10+
doc
11+
12+
## git-changelog-maven-plugin-1.0
13+
### Other changes
14+
815
doc
916

1017
Initial

‎git-changelog-maven-plugin-example/pom.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
1616
<plugin>
1717
<groupId>se.bjurr.gitchangelog</groupId>
1818
<artifactId>git-changelog-maven-plugin</artifactId>
19-
<version>1.0-SNAPSHOT</version>
19+
<version>1.1-SNAPSHOT</version>
2020
<executions>
2121
<execution>
2222
<id>GenerateGitChangelog</id>
@@ -28,7 +28,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
2828
<toRef>refs/heads/master</toRef>
2929
<templateFile>changelog.mustache</templateFile>
3030
<settingsFile>changelog.json</settingsFile>
31+
32+
<!-- A file on filesystem //-->
3133
<filePath>CHANGELOG.md</filePath>
34+
35+
<!-- Or post to MediaWiki //-->
36+
<!--mediaWikiUsername>tomas</mediaWikiUsername>
37+
<mediaWikiPassword>tomaskod</mediaWikiPassword>
38+
<mediaWikiUrl>http://localhost/mediawiki</mediaWikiUrl>
39+
<mediaWikiTitle>Tomas Title</mediaWikiTitle //-->
3240
</configuration>
3341
</execution>
3442
</executions>

‎pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>se.bjurr.gitchangelog</groupId>
7171
<artifactId>git-changelog-lib</artifactId>
72-
<version>1.1</version>
72+
<version>1.2</version>
7373
</dependency>
7474
</dependencies>
7575

‎src/main/java/se/bjurr/gitchangelog/plugin/GitChangelogMojo.java

+24-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@ public class GitChangelogMojo extends AbstractMojo {
3030
private String settingsFile;
3131
@Parameter(property = "templateFile", required = false)
3232
private String templateFile;
33-
@Parameter(property = "filePath", required = true)
33+
@Parameter(property = "filePath", required = false)
3434
private String filePath;
3535

36+
@Parameter(property = "mediaWikiUrl", required = false)
37+
private String mediaWikiUrl;
38+
@Parameter(property = "mediaWikiTitle", required = false)
39+
private String mediaWikiTitle;
40+
@Parameter(property = "mediaWikiUsername", required = false)
41+
private String mediaWikiUsername;
42+
@Parameter(property = "mediaWikiPassword", required = false)
43+
private String mediaWikiPassword;
44+
3645
@Override
3746
public void execute() throws MojoExecutionException {
3847
try {
@@ -55,10 +64,21 @@ public void execute() throws MojoExecutionException {
5564
.withToCommit(toCommit);
5665
}
5766

58-
builder //
59-
.toFile(filePath);
67+
if (!isNullOrEmpty(filePath)) {
68+
builder //
69+
.toFile(filePath);
70+
getLog().info("Git Changelog written to " + filePath);
71+
}
6072

61-
getLog().info("Git Changelog written to " + filePath);
73+
if (!isNullOrEmpty(mediaWikiUrl)) {
74+
builder//
75+
.toMediaWiki(//
76+
mediaWikiUsername,//
77+
mediaWikiPassword, //
78+
mediaWikiUrl,//
79+
mediaWikiTitle);
80+
getLog().info("Git Changelog written to " + mediaWikiUrl + "/index.php/" + mediaWikiTitle);
81+
}
6282
} catch (MalformedURLException e) {
6383
getLog().error("GitChangelog", e);
6484
}

0 commit comments

Comments
 (0)
Please sign in to comment.