Add enforcer for the version tag in CHANGELOG.md.
This commit is contained in:
parent
9802ce9e42
commit
4b88c3e8a2
27
pom.xml
27
pom.xml
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue