Skip to content

Commit d9de827

Browse files
committed
Configure maven-release-plugin and git-cliff
1 parent e9d02be commit d9de827

File tree

6 files changed

+267
-13
lines changed

6 files changed

+267
-13
lines changed

changelog.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
CURRENT_DIR=$(basename $PWD)
3+
if [ "$CURRENT_DIR" = "kraken-api-java" ]
4+
then
5+
echo Generating changelog in CHANGELOG.md
6+
git cliff -o CHANGELOG.md
7+
fi

cliff.toml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
9+
[changelog]
10+
11+
# changelog header
12+
header = """
13+
# Changelog\n
14+
All notable changes to this project will be documented in this file.\n
15+
"""
16+
17+
# template for the changelog body
18+
# https://keats.github.io/tera/docs/#introduction
19+
body = """
20+
{% if version %}\
21+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
22+
{% else %}\
23+
## [unreleased]
24+
{% endif %}\
25+
{% for group, commits in commits | group_by(attribute="group") %}
26+
### {{ group | upper_first }}
27+
{% for commit in commits %}
28+
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
29+
{% endfor %}
30+
{% endfor %}\n
31+
"""
32+
33+
# template for the changelog footer
34+
footer = """
35+
<!-- generated by git-cliff -->
36+
"""
37+
38+
# remove the leading and trailing s
39+
trim = true
40+
41+
# postprocessors
42+
postprocessors = [
43+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
44+
]
45+
46+
47+
[git]
48+
49+
# parse the commits based on https://www.conventionalcommits.org
50+
conventional_commits = true
51+
52+
# filter out the commits that are not conventional
53+
filter_unconventional = false
54+
55+
# process each line of a commit as an individual commit
56+
split_commits = false
57+
58+
# regex for preprocessing the commit messages
59+
commit_preprocessors = [
60+
# Replace issue numbers
61+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
62+
# Check spelling of the commit with https://github.com/crate-ci/typos
63+
# If the spelling is incorrect, it will be automatically fixed.
64+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
65+
]
66+
67+
# regex for parsing and grouping commits
68+
commit_parsers = [
69+
{ message = "^feat", group = "Features" },
70+
{ message = "^fix", group = "Bug Fixes" },
71+
{ message = "^doc", group = "Documentation" },
72+
{ message = "^perf", group = "Performance" },
73+
{ message = "^refactor", group = "Refactor" },
74+
{ message = "^style", group = "Styling" },
75+
{ message = "^test", group = "Testing" },
76+
{ message = "^chore\\(release\\): prepare for", skip = true },
77+
{ message = "^chore\\(deps\\)", skip = true },
78+
{ message = "^chore\\(pr\\)", skip = true },
79+
{ message = "^chore\\(pull\\)", skip = true },
80+
{ message = "^(chore|ci)", group = "Miscellaneous Tasks" },
81+
{ message = "^revert", group = "Revert" },
82+
{ message = "^\\[maven-release-plugin\\]", skip = true },
83+
{ message = ".*", group = "Other" },
84+
]
85+
86+
# protect breaking changes from being skipped due to matching a skipping commit_parser
87+
protect_breaking_commits = false
88+
89+
# filter out the commits that are not matched by commit parsers
90+
filter_commits = false
91+
92+
# regex for matching git tags
93+
tag_pattern = "v[0-9].*"
94+
95+
# sort the commits inside sections by oldest/newest order
96+
sort_commits = "newest"

examples/pom.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,32 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>edu.self.nyg</groupId>
8+
<groupId>dev.andstuff.kraken</groupId>
99
<artifactId>kraken-api-parent</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
10+
<version>0.1.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>kraken-api-examples</artifactId>
1414

1515
<dependencies>
1616
<dependency>
17-
<groupId>edu.self.nyg</groupId>
17+
<groupId>dev.andstuff.kraken</groupId>
1818
<artifactId>kraken-api</artifactId>
1919
<version>${project.version}</version>
2020
</dependency>
2121
</dependencies>
2222

23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>org.apache.maven.plugins</groupId>
27+
<artifactId>maven-deploy-plugin</artifactId>
28+
<version>${maven-deploy-plugin.version}</version>
29+
<configuration>
30+
<skip>true</skip>
31+
</configuration>
32+
</plugin>
33+
</plugins>
34+
</build>
35+
2336
</project>

library/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>edu.self.nyg</groupId>
8+
<groupId>dev.andstuff.kraken</groupId>
99
<artifactId>kraken-api-parent</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
10+
<version>0.1.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>kraken-api</artifactId>

pom.xml

Lines changed: 144 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,67 @@
44

55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>edu.self.nyg</groupId>
7+
<groupId>dev.andstuff.kraken</groupId>
88
<artifactId>kraken-api-parent</artifactId>
9-
<version>1.0.0-SNAPSHOT</version>
9+
<version>0.1.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

12-
<properties>
13-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<maven.compiler.release>21</maven.compiler.release>
12+
<name>Java Kraken API Client</name>
13+
<description>A Kraken.com API client written in Java</description>
14+
<url>https://github.com/nyg/kraken-api-java</url>
15+
<inceptionYear>2015</inceptionYear>
1516

16-
<!-- Third-party dependencies -->
17-
<lombok.version>1.18.28</lombok.version>
18-
</properties>
17+
<licenses>
18+
<license>
19+
<name>ISC License</name>
20+
<url>https://github.com/nyg/kraken-api-java/blob/master/LICENSE</url>
21+
<distribution>repo</distribution>
22+
</license>
23+
</licenses>
24+
25+
<developers>
26+
<developer>
27+
<name>nyg</name>
28+
<url>https://github.com/nyg</url>
29+
</developer>
30+
</developers>
1931

2032
<modules>
2133
<module>library</module>
2234
<module>examples</module>
2335
</modules>
2436

37+
<scm>
38+
<url>https://github.com/nyg/kraken-api-java</url>
39+
<connection>scm:git:https://github.com/nyg/kraken-api-java.git</connection>
40+
<developerConnection>scm:git:ssh://[email protected]/nyg/kraken-api-java.git</developerConnection>
41+
<tag>HEAD</tag>
42+
</scm>
43+
44+
<issueManagement>
45+
<url>https://github.com/nyg/kraken-api-java/issues</url>
46+
<system>GitHub Issues</system>
47+
</issueManagement>
48+
49+
<properties>
50+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
51+
<maven.compiler.release>21</maven.compiler.release>
52+
53+
<!-- Third-party dependencies -->
54+
<lombok.version>1.18.30</lombok.version>
55+
56+
<!-- Maven plugins -->
57+
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
58+
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
59+
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
60+
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
61+
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
62+
63+
<!-- Third-party plugins -->
64+
<central-publishing-maven-plugin.version>0.2.0</central-publishing-maven-plugin.version>
65+
<exec-maven-plugin.version>3.1.1</exec-maven-plugin.version>
66+
</properties>
67+
2568
<dependencyManagement>
2669
<dependencies>
2770
<dependency>
@@ -33,4 +76,97 @@
3376
</dependencies>
3477
</dependencyManagement>
3578

79+
<build>
80+
<plugins>
81+
<plugin>
82+
<groupId>org.codehaus.mojo</groupId>
83+
<artifactId>exec-maven-plugin</artifactId>
84+
<version>${exec-maven-plugin.version}</version>
85+
<configuration>
86+
<executable>./changelog.sh</executable>
87+
</configuration>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-release-plugin</artifactId>
92+
<version>${maven-release-plugin.version}</version>
93+
<configuration>
94+
<!-- release:prepare -->
95+
<autoVersionSubmodules>true</autoVersionSubmodules>
96+
<tagNameFormat>v@{version}</tagNameFormat>
97+
<signTag>true</signTag>
98+
<preparationGoals>clean verify exec:exec</preparationGoals>
99+
<pushChanges>false</pushChanges>
100+
<!-- release:perform -->
101+
<releaseProfiles>maven-central</releaseProfiles>
102+
</configuration>
103+
</plugin>
104+
</plugins>
105+
</build>
106+
107+
<profiles>
108+
<profile>
109+
<id>maven-central</id>
110+
<build>
111+
<plugins>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-source-plugin</artifactId>
115+
<version>${maven-source-plugin.version}</version>
116+
<executions>
117+
<execution>
118+
<id>attach-sources</id>
119+
<goals>
120+
<goal>jar-no-fork</goal>
121+
</goals>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-javadoc-plugin</artifactId>
128+
<version>${maven-javadoc-plugin.version}</version>
129+
<executions>
130+
<execution>
131+
<id>attach-javadocs</id>
132+
<goals>
133+
<goal>jar</goal>
134+
</goals>
135+
</execution>
136+
</executions>
137+
</plugin>
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-gpg-plugin</artifactId>
141+
<version>${maven-gpg-plugin.version}</version>
142+
<executions>
143+
<execution>
144+
<id>sign-artifacts</id>
145+
<goals>
146+
<goal>sign</goal>
147+
</goals>
148+
</execution>
149+
</executions>
150+
<configuration>
151+
<keyname>F8E60A60EB7F12AA</keyname>
152+
</configuration>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.sonatype.central</groupId>
156+
<artifactId>central-publishing-maven-plugin</artifactId>
157+
<version>${central-publishing-maven-plugin.version}</version>
158+
<extensions>true</extensions>
159+
<configuration>
160+
<publishingServerId>central</publishingServerId>
161+
<tokenEnabled>true</tokenEnabled>
162+
<excludeArtifacts>
163+
<artifact>kraken-api-examples</artifact>
164+
</excludeArtifacts>
165+
</configuration>
166+
</plugin>
167+
</plugins>
168+
</build>
169+
</profile>
170+
</profiles>
171+
36172
</project>

release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mvn -B release:prepare release:perform
2+
git fetch

0 commit comments

Comments
 (0)