Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean up dependencies.

  • Loading branch information...
commit e070f8e3293ec79104420254712084964f28c5ee 1 parent 4d80c5c
@mmichaelis authored
View
54 pom.xml
@@ -63,11 +63,29 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>${maven.version}</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -83,7 +101,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>2.0.7</version>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
@@ -93,24 +111,12 @@
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-module-junit4</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-core</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
<artifactId>powermock-api-support</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
@@ -118,8 +124,19 @@
<dependency>
<groupId>org.jvnet.mock-javamail</groupId>
<artifactId>mock-javamail</artifactId>
- <version>1.9</version>
+ <!-- TODO: 1.9 not yet available on central -->
+ <version>1.7</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -139,6 +156,12 @@
<version>0.9.26</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -207,6 +230,7 @@
<goal>analyze-only</goal>
</goals>
<configuration>
+ <ignoreNonCompile>true</ignoreNonCompile>
<failOnWarning>true</failOnWarning>
</configuration>
</execution>
@@ -299,6 +323,7 @@
</profiles>
<!-- Todo: Should be removed before uploading to central -->
+<!--
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
@@ -307,5 +332,6 @@
<layout>default</layout>
</repository>
</repositories>
+-->
</project>
View
10 src/test/java/de/mmichaelis/maven/mojo/MailDevelopersMojoTest.java
@@ -31,13 +31,10 @@
import javax.mail.Message;
import java.io.InputStream;
import java.io.StringWriter;
-import java.io.Writer;
import java.util.Arrays;
import java.util.Date;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
@@ -57,7 +54,6 @@
private static final int MAX_DEVELOPERS = 4;
private MailDevelopersMojoWrapper mojoWrapper;
- private MessageWrapper messageWrapper;
private Developer[] developers;
@Before
@@ -72,7 +68,7 @@ public void setUp() throws Exception {
}
mojoWrapper = new MailDevelopersMojoWrapper(new MailDevelopersMojo());
- messageWrapper = new MessageWrapper(new de.mmichaelis.maven.mojo.Message());
+ final MessageWrapper messageWrapper = new MessageWrapper(new de.mmichaelis.maven.mojo.Message());
messageWrapper.setText("Lorem Ipsum Dolor Sit Amet.");
mojoWrapper.setMessage(messageWrapper.getWrapped());
}
@@ -142,7 +138,7 @@ public void testFullyConfiguredMail() throws Exception {
final Date now = new Date();
mojoWrapper.execute();
final Mailbox inbox = Mailbox.get(developers[0].getEmail());
- assertEquals("One new email for the first developer.", 1, inbox.getNewMessageCount());
+ assertEquals("One new email for the first developer.", 1, inbox.size());
final Message message = inbox.get(0);
assertTrue("Sent date should signal to be today.", DateUtils.isSameDay(now, message.getSentDate()));
assertEquals("Size of recipients should match number of developers.", developers.length, message.getAllRecipients().length);
View
67 src/test/resources/de/mmichaelis/maven/mojo/sample-001-pom.xml
@@ -0,0 +1,67 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2011 Mark Michaelis ~
+ ~ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~
+ ~ you may not use this file except in compliance with the License. ~
+ ~ You may obtain a copy of the License at ~
+ ~ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0 ~
+ ~ ~
+ ~ Unless required by applicable law or agreed to in writing, software ~
+ ~ distributed under the License is distributed on an "AS IS" BASIS, ~
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~
+ ~ See the License for the specific language governing permissions and ~
+ ~ limitations under the License. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>de.mmichaelis</groupId>
+ <artifactId>sample-001</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <name>Mail Developers Sample 001</name>
+
+ <developers>
+ <developer>
+ <id>test-dev01</id>
+ <email>dev01@localhost</email>
+ </developer>
+ </developers>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>de.mmichaelis</groupId>
+ <artifactId>maven-mail-plugin</artifactId>
+ <version>${project.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>de.mmichaelis</groupId>
+ <artifactId>maven-mail-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>sample-mail</id>
+ <goals>
+ <goal>mail-developers</goal>
+ </goals>
+ <phase>compile</phase>
+ <configuration>
+ <message>
+ <text>Test mail.</text>
+ </message>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Please sign in to comment.
Something went wrong with that request. Please try again.