Skip to content

Instantly share code, notes, and snippets.

@bmatthews68
Created February 15, 2012 22:09
Show Gist options
  • Select an option

  • Save bmatthews68/1839359 to your computer and use it in GitHub Desktop.

Select an option

Save bmatthews68/1839359 to your computer and use it in GitHub Desktop.
emailserver-maven-plugin dependency declaration
package com.btmatthews.maven.plugins.emailserver.test;
import com.icegreen.greenmail.util.GreenMailUtil;
import com.icegreen.greenmail.util.ServerSetup;
public class ITestMailServer
{
@Test
public void testSendMail()
{
GreenMailUtil.sendTextEmail("bmatthews68@gmail.com", "brian@btmatthews.com", "Testing", "One Two Three ...", ServerSetup.SMTP);
}
}
<plugin>
<groupId>com.btmatthews.maven.plugins</groupId>
<artifactId>emailserver-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<build>
...
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12</version>
</plugin>
<plugin>
<groupId>com.btmatthews.maven.plugins</groupId>
<artifactId>emailserver-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
...
</plugins>
</pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.btmatthews.maven.plugins</groupId>
<artifactId>emailserver-maven-plugin</artifactId>
<configuration>
<monitorPort>10025</monitorPort>
<monitorKey>emailserver</monitorKey>
</configuration>
<executions>
<execution>
<id>start-mail</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
<goals>
<configuration>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-mail</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
<goals>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
....
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment