|
Project Information
Featured
Downloads
Links
|
Tweet your builds IntroductionMaven Twitter Plugin lets you send Twitter status updates from Maven, without writing any Java code. It increases communication between Project owners and Project users by automatically tweeting build and release status via Twitter. ConfigurationAdd your twitter username, password to your ~/.m2/settings.xml fileFor security reasons, it is recommended that you put your twitter username and password in your local settings file. <settings>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<twitterUsername>your twitter username</twitterUsername>
<twitterPassword>your twitter password</twitterPassword>
</properties>
</profile>
</profiles>
</settings>UsageAdd the Twitter plugin to your <project> <build> <plugins> section in pom.xmlDefine the plugin as shown in example below. It will send one Twitter status update per <execution> block defined. The <execution> block contains the twitterStatus and will be executed in the phase specified by the <phase> sub-element. <execution> <phase>...</phase> <configuration> <twitterStatus>...</twitterStatus> </configuration> </execution> You can define as many blocks as you want. Example<plugin>
<groupId>com.vineetmanohar</groupId>
<artifactId>maven-twitter-plugin</artifactId>
<version>0.1</version>
<executions>
<!-- phase: test -->
<execution>
<id>test-passed</id>
<configuration>
<!-- anything you want, upto 140 chars -->
<twitterStatus>My first tweet from using #maven twitter plugin</twitterStatus>
</configuration>
<phase>test</phase>
<goals>
<goal>tweet</goal>
</goals>
</execution>
<!-- phase: deploy -->
<execution>
<configuration>
<!-- Tell your users that the project is deployed -->
<twitterStatus>Version ${project.version} of XYZ deployed</twitterStatus>
</configuration>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>tweet</goal>
</goals>
</execution>
</executions>
</plugin>FAQWhat can I put under the <twitterStatus> element
What happens if I send multiple message with the same textTwitter seems to ignore status updates if there is not status change from your. What happens if my <twitterStatus> is more than 140 charactersThe current version does not check for length and will send your message to Twitter. Twitter will respond with an error. Does this plugin support URL shortening?Not yet. Does maven execution stop if the Twitter Plugin failsNo. All errors are logged, but no Exception is thrown. Is there a limit to how many messages I can send?Yes. Twitter has a rate limit of 150 message per hour. See details. What are all the different Maven phasesHere's Maven's documentation on Phases |