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>
|
||||
</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>
|
||||
</build>
|
||||
|
||||
|
|
Loading…
Reference in New Issue