【发布时间】:2015-01-21 13:16:02
【问题描述】:
我想在构建阶段向频道/用户发送特定的松弛消息。我知道我可以创建一个 maven 插件,也许已经有一个?
【问题讨论】:
-
到目前为止你尝试过什么?
我想在构建阶段向频道/用户发送特定的松弛消息。我知道我可以创建一个 maven 插件,也许已经有一个?
【问题讨论】:
自己做的:https://github.com/moacyrricardo/maven-slack
有了这个插件,你所要做的就是添加一个 webhook 到 slack 并使用 url 来发布消息。
要使用它,请将“s3 wagon extension”添加到您的 pom.xml:
<build>
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>3.0.0.RELEASE</version>
</extension>
</extensions>
</build>
然后是插件仓库:
<pluginRepository>
<id>s3-moarepo</id>
<url>s3://moarepo/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>s3-moarepo-snapshot</id>
<url>s3://moarepo/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
终于可以使用了
<plugin>
<groupId>br.com.kibutx</groupId>
<artifactId>slack-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>MSG inicio deploy</id>
<phase>validate</phase>
<goals>
<goal>slackmessage</goal>
</goals>
<configuration>
<apiHash>hash1/hash2/hash3</apiHash>
<channel>@devmate</channel>
<message>Short message</message>
<fields>
<field>
<value>Field 1 value</value>
</field>
</fields>
</configuration>
</execution>
</executions>
</plugin>
【讨论】: