Add enforcer for the version tag in CHANGELOG.md.

This commit is contained in:
Manuele Simi 2020-06-21 16:09:23 -04:00
parent 9802ce9e42
commit 4b88c3e8a2
1 changed files with 27 additions and 0 deletions

27
pom.xml
View File

@ -924,6 +924,33 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<defaults>
<name>tag</name>
</defaults>
<source>
def fileContents = new File("${project.basedir}/CHANGELOG.md").getText('UTF-8')
matcher = (fileContents =~ /(?s).\[v$project.version\].*?/)
if (!matcher.find()) {
throw new IllegalArgumentException("Tag [v$project.version] not found in CHANGELOG.md")
}
assert matcher[0][1]: "Tag [v$project.version] not found in CHANGELOG.md"
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>