The Unified and Autonomous Development Platform
Unit test sample for static methods using Mochito and PowerMock.
robin shine87c9495f890e
diff --git a/commons.git/src/main/java/com/pmease/commons/git/BranchCommand.java b/commons.git/src/main/java/com/pmease/commons/git/BranchCommand.javanew file mode 100644index 0000000000..969ef059f3--- /dev/null+++ b/commons.git/src/main/java/com/pmease/commons/git/BranchCommand.java@@ -0,0 +1,37 @@+package com.pmease.commons.git;++import com.google.common.base.Preconditions;+import com.pmease.commons.util.execution.Commandline;++/**+ * This class can be used to create new branches.+ *+ * @author robin+ *+ */+public class BranchCommand extends GitCommand<Git> {++ private String branchName;++ public BranchCommand(final Git git) {+ super(git);+ }++ public BranchCommand branchName(String branchName) {+ this.branchName = branchName;+ return this;+ }++ @Override+ public Git call() {+ Preconditions.checkNotNull(branchName, "branch has to be specified.");++ Commandline cmd = git().cmd().addArgs("checkout", "-b");+ cmd.addArgs(branchName);++ cmd.execute(debugLogger(), errorLogger()).checkReturnCode();++ return git();+ }++}diff --git a/commons.git/src/main/java/com/pmease/commons/git/CheckoutCommand.java b/commons.git/src/main/java/com/pmease/commons/git/CheckoutCommand.javanew file mode 100644index 0000000000..9f5b87048d--- /dev/null+++ b/commons.git/src/main/java/com/pmease/commons/git/CheckoutCommand.java@@ -0,0 +1,39 @@+package com.pmease.commons.git;++import com.google.common.base.Preconditions;+import com.pmease.commons.util.execution.Commandline;++public class CheckoutCommand extends GitCommand<Git> {++ private String revision;++ public CheckoutCommand(final Git git) {+ super(git);+ }++ /**+ * Specify git revision for checkout. Can also accept branch name.+ *+ * @param revision+ * revision to be checked out+ * @return+ * self+ */+ public CheckoutCommand revision(String revision) {+ this.revision = revision;+ return this;+ }++ @Override+ public Git call() {+ Preconditions.checkNotNull(revision, "revision has to be specified.");++ Commandline cmd = git().cmd().addArgs("checkout");+ cmd.addArgs(revision);++ cmd.execute(debugLogger(), errorLogger()).checkReturnCode();++ return git();+ }++}diff --git a/commons.git/src/main/java/com/pmease/commons/git/DeleteRefCommand.java b/commons.git/src/main/java/com/pmease/commons/git/DeleteRefCommand.javanew file mode 100644index 0000000000..6b72d4b175--- /dev/null+++ b/commons.git/src/main/java/com/pmease/commons/git/DeleteRefCommand.java@@ -0,0 +1,49 @@+package com.pmease.commons.git;++import com.google.common.base.Preconditions;+import com.pmease.commons.util.execution.Commandline;++public class DeleteRefCommand extends GitCommand<Git> {++ private String refName;++ private String oldRevision;++ private String reason;++ public DeleteRefCommand(Git git) {+ super(git);+ }++ public DeleteRefCommand refName(String refName) {+ this.refName = refName;+ return this;+ }++ public DeleteRefCommand oldRevision(String oldRevision) {+ this.oldRevision = oldRevision;+ return this;+ }++ public DeleteRefCommand reason(String reason) {+ this.reason = reason;+ return this;+ }++ @Override+ public Git call() {+ Preconditions.checkNotNull(refName, "refName has to be specified.");++ Commandline cmd = git().cmd().addArgs("update-ref", "-d", refName);+ if (oldRevision != null)+ cmd.addArgs(oldRevision);++ if (reason != null)+ cmd.addArgs(reason);++ cmd.execute(debugLogger(), errorLogger()).checkReturnCode();++ return git();+ }++}diff --git a/commons.git/src/main/java/com/pmease/commons/git/Git.java b/commons.git/src/main/java/com/pmease/commons/git/Git.javaindex fd4fc8cd5f..4ee074fc35 100644--- a/commons.git/src/main/java/com/pmease/commons/git/Git.java+++ b/commons.git/src/main/java/com/pmease/commons/git/Git.java@@ -4,6 +4,7 @@ import java.io.File;import org.apache.commons.lang3.exception.ExceptionUtils;+import com.pmease.commons.util.FileUtils;import com.pmease.commons.util.execution.Commandline;import com.pmease.commons.util.execution.LineConsumer;@@ -17,6 +18,12 @@ public class Git {public Git(final File repoDir) {this.repoDir = repoDir;+ if (!repoDir.exists())+ FileUtils.createDir(repoDir);+ }++ public File repoDir() {+ return repoDir;}public UploadCommand upload() {@@ -39,6 +46,10 @@ public class Git {return new InitCommand(this);}+ public MergeCommand merge() {+ return new MergeCommand(this);+ }+public AddCommand add() {return new AddCommand(this);}@@ -59,12 +70,28 @@ public class Git {return new CalcMergeBaseCommand(this);}- /**+ public UpdateRefCommand updateRef() {+ return new UpdateRefCommand(this);+ }++ public DeleteRefCommand deleteRef() {+ return new DeleteRefCommand(this);+ }++ public CheckoutCommand checkout() {+ return new CheckoutCommand(this);+ }++ public BranchCommand branch() {+ return new BranchCommand(this);+ }++ /*** Check if there are any errors with git command line.** @return* error message if failed to check git command line,- * or <code>null</code> otherwise+ * or <tt>null</tt> otherwise**/public static String checkError() {diff --git a/commons.git/src/main/java/com/pmease/commons/git/MergeCommand.java b/commons.git/src/main/java/com/pmease/commons/git/MergeCommand.javanew file mode 100644index 0000000000..ecc46a187e--- /dev/null+++ b/commons.git/src/main/java/com/pmease/commons/git/MergeCommand.java@@ -0,0 +1,39 @@+package com.pmease.commons.git;++import com.google.common.base.Preconditions;+import com.pmease.commons.util.execution.Commandline;++public class MergeCommand extends GitCommand<Git> {++ private String revision;++ public MergeCommand(final Git git) {+ super(git);+ }++ /**+ * Specify git revision for checkout. Can also accept branch name.+ *+ * @param revision+ * revision to be checked out+ * @return+ * self+ */+ public MergeCommand revision(String revision) {+ this.revision = revision;+ return this;+ }++ @Override+ public Git call() {+ Preconditions.checkNotNull(revision, "revision has to be specified.");++ Commandline cmd = git().cmd().addArgs("merge");+ cmd.addArgs(revision);++ cmd.execute(debugLogger(), errorLogger()).checkReturnCode();++ return git();+ }++}diff --git a/commons.git/src/main/java/com/pmease/commons/git/UpdateRefCommand.java b/commons.git/src/main/java/com/pmease/commons/git/UpdateRefCommand.javanew file mode 100644index 0000000000..ae94c267a3--- /dev/null+++ b/commons.git/src/main/java/com/pmease/commons/git/UpdateRefCommand.java@@ -0,0 +1,57 @@+package com.pmease.commons.git;++import com.google.common.base.Preconditions;+import com.pmease.commons.util.execution.Commandline;++public class UpdateRefCommand extends GitCommand<Git> {++ private String refName;++ private String revision;++ private String oldRevision;++ private String reason;++ public UpdateRefCommand(Git git) {+ super(git);+ }++ public UpdateRefCommand refName(String refName) {+ this.refName = refName;+ return this;+ }++ public UpdateRefCommand revision(String revision) {+ this.revision = revision;+ return this;+ }++ public UpdateRefCommand oldRevision(String oldRevision) {+ this.oldRevision = oldRevision;+ return this;+ }++ public UpdateRefCommand reason(String reason) {+ this.reason = reason;+ return this;+ }++ @Override+ public Git call() {+ Preconditions.checkNotNull(refName, "refName has to be specified.");+ Preconditions.checkNotNull(revision, "revision has to be specified.");++ Commandline cmd = git().cmd().addArgs("update-ref", refName, revision);+ if (oldRevision != null)+ cmd.addArgs(oldRevision);++ if (reason != null)+ cmd.addArgs(reason);++ cmd.execute(debugLogger(), errorLogger()).checkReturnCode();++ return git();+ }++}diff --git a/commons.git/src/test/java/com/pmease/commons/git/GitCommandTest.java b/commons.git/src/test/java/com/pmease/commons/git/GitCommandTest.javadeleted file mode 100644index e3d1859da8..0000000000--- a/commons.git/src/test/java/com/pmease/commons/git/GitCommandTest.java+++ /dev/null@@ -1,28 +0,0 @@-package com.pmease.commons.git;--import java.io.File;--import org.junit.After;-import org.junit.Assume;-import org.junit.Before;--import com.pmease.commons.util.FileUtils;--public abstract class GitCommandTest {-- protected File repoDir;-- @Before- public void before() {- Assume.assumeTrue(Git.checkError() == null);-- repoDir = FileUtils.createTempDir();- }-- @After- public void after() {- if (repoDir != null)- FileUtils.deleteDir(repoDir);- }--}diff --git a/commons.git/src/test/java/com/pmease/commons/git/ListChangedFilesCommandTest.java b/commons.git/src/test/java/com/pmease/commons/git/ListChangedFilesCommandTest.javaindex 12e7418763..0d3f1998bf 100644--- a/commons.git/src/test/java/com/pmease/commons/git/ListChangedFilesCommandTest.java+++ b/commons.git/src/test/java/com/pmease/commons/git/ListChangedFilesCommandTest.java@@ -9,35 +9,40 @@ import org.junit.Test;import com.google.common.collect.Sets;import com.pmease.commons.util.FileUtils;-public class ListChangedFilesCommandTest extends GitCommandTest {+public class ListChangedFilesCommandTest {@Testpublic void shouldListChangedFiles() {- Git git = new Git(repoDir).init().call();-- FileUtils.touchFile(new File(repoDir, "a"));- git.add().addPath("a").call();- git.commit().message("commit").call();-- FileUtils.touchFile(new File(repoDir, "b"));- git.add().addPath("b").call();- git.commit().message("commit").call();-- FileUtils.touchFile(new File(repoDir, "c"));- git.add().addPath("c").call();- git.commit().message("commit").call();-- FileUtils.touchFile(new File(repoDir, "d"));- git.add().addPath("d").call();- git.commit().message("commit").call();-- FileUtils.writeFile(new File(repoDir, "a"), "a");- git.add().addPath("a").call();- git.commit().message("commit").call();-- Collection<String> changedFiles = git.findChangedFiles().fromRev("HEAD~4").toRev("HEAD").call();-- Assert.assertTrue(changedFiles.containsAll(Sets.newHashSet("a", "b", "c", "d")));+ Assert.assertTrue(Git.checkError() == null);+ Git git = new Git(FileUtils.createTempDir()).init().call();++ try {+ FileUtils.touchFile(new File(git.repoDir(), "a"));+ git.add().addPath("a").call();+ git.commit().message("commit").call();++ FileUtils.touchFile(new File(git.repoDir(), "b"));+ git.add().addPath("b").call();+ git.commit().message("commit").call();++ FileUtils.touchFile(new File(git.repoDir(), "c"));+ git.add().addPath("c").call();+ git.commit().message("commit").call();++ FileUtils.touchFile(new File(git.repoDir(), "d"));+ git.add().addPath("d").call();+ git.commit().message("commit").call();++ FileUtils.writeFile(new File(git.repoDir(), "a"), "a");+ git.add().addPath("a").call();+ git.commit().message("commit").call();++ Collection<String> changedFiles = git.findChangedFiles().fromRev("HEAD~4").toRev("HEAD").call();++ Assert.assertTrue(changedFiles.containsAll(Sets.newHashSet("a", "b", "c", "d")));+ } finally {+ FileUtils.deleteDir(git.repoDir());+ }}}diff --git a/gitop.core/src/test/java/com/pmease/gitop/core/model/MergeRequestTest.java b/gitop.core/src/test/java/com/pmease/gitop/core/model/MergeRequestTest.javanew file mode 100644index 0000000000..0bbee64454--- /dev/null+++ b/gitop.core/src/test/java/com/pmease/gitop/core/model/MergeRequestTest.java@@ -0,0 +1,159 @@+package com.pmease.gitop.core.model;++import java.io.File;++import org.junit.After;+import org.junit.Assert;+import org.junit.Before;+import org.junit.Test;+import org.junit.runner.RunWith;+import org.mockito.Mock;+import org.mockito.Mockito;+import org.mockito.MockitoAnnotations;+import org.powermock.api.mockito.PowerMockito;+import org.powermock.core.classloader.annotations.PrepareForTest;+import org.powermock.modules.junit4.PowerMockRunner;++import com.pmease.commons.git.Git;+import com.pmease.commons.loader.AppLoader;+import com.pmease.commons.util.FileUtils;+import com.pmease.gitop.core.manager.StorageManager;+import com.pmease.gitop.core.storage.ProjectStorage;++@RunWith(PowerMockRunner.class)+@PrepareForTest(AppLoader.class)+public class MergeRequestTest {++ private File projectDir;++ private Git git;++ @Mock+ private StorageManager storageManager;++ @Before+ public void before() {+ Assert.assertTrue(Git.checkError() == null);+ projectDir = FileUtils.createTempDir();++ git = new Git(new File(projectDir, "code")).init().call();++ MockitoAnnotations.initMocks(this);+ }++ @After+ public void after() {+ FileUtils.deleteDir(projectDir);+ }++ @Test+ public void shouldReturnAllUpdatesAsEffectiveIfTheyAreFastForward() {+ FileUtils.touchFile(new File(git.repoDir(), "a"));+ git.add().addPath("a").call();+ git.commit().message("commit").call();++ git.branch().branchName("dev").call();++ FileUtils.touchFile(new File(git.repoDir(), "b"));+ git.add().addPath("b").call();+ git.commit().message("commit").call();++ git.updateRef().refName("refs/updates/1").revision("HEAD").call();++ FileUtils.touchFile(new File(git.repoDir(), "c"));+ git.add().addPath("c").call();+ git.commit().message("commit").call();++ git.updateRef().refName("refs/updates/2").revision("HEAD").call();++ PowerMockito.mockStatic(AppLoader.class);+ Mockito.when(AppLoader.getInstance(StorageManager.class)).thenReturn(storageManager);++ Mockito.when(storageManager.getStorage(Mockito.any(Project.class)))+ .thenReturn(new ProjectStorage(projectDir));++ MergeRequest mergeRequest = new MergeRequest();+ Branch destBranch = new Branch();+ destBranch.setName("master");+ destBranch.setProject(new Project());+ mergeRequest.setDestination(destBranch);++ MergeRequestUpdate update = new MergeRequestUpdate();+ update.setId(1L);+ update.setRequest(mergeRequest);+ mergeRequest.getUpdates().add(update);++ update = new MergeRequestUpdate();+ update.setId(2L);+ update.setRequest(mergeRequest);+ mergeRequest.getUpdates().add(update);++ Assert.assertEquals(mergeRequest.getEffectiveUpdates().size(), 2);+ }++ @Test+ public void shouldReturnLatestUpdateAsEffectiveIfAllOthersHaveBeenMerged() {+ FileUtils.touchFile(new File(git.repoDir(), "a"));+ git.add().addPath("a").call();+ git.commit().message("commit").call();++ git.branch().branchName("dev").call();++ FileUtils.touchFile(new File(git.repoDir(), "b"));+ git.add().addPath("b").call();+ git.commit().message("commit").call();++ git.updateRef().refName("refs/updates/1").revision("HEAD").call();++ FileUtils.touchFile(new File(git.repoDir(), "c"));+ git.add().addPath("c").call();+ git.commit().message("commit").call();++ git.updateRef().refName("refs/updates/2").revision("HEAD").call();++ FileUtils.touchFile(new File(git.repoDir(), "d"));+ git.add().addPath("d").call();+ git.commit().message("commit").call();++ git.updateRef().refName("refs/updates/3").revision("HEAD").call();++ git.checkout().revision("master").call();++ FileUtils.touchFile(new File(git.repoDir(), "e"));+ git.add().addPath("e").call();+ git.commit().message("commit").call();++ git.merge().revision("refs/updates/2").call();++ PowerMockito.mockStatic(AppLoader.class);+ Mockito.when(AppLoader.getInstance(StorageManager.class)).thenReturn(storageManager);++ Mockito.when(storageManager.getStorage(Mockito.any(Project.class)))+ .thenReturn(new ProjectStorage(projectDir));++ MergeRequest mergeRequest = new MergeRequest();+ Branch destBranch = new Branch();+ destBranch.setName("master");+ destBranch.setProject(new Project());+ mergeRequest.setDestination(destBranch);++ MergeRequestUpdate update = new MergeRequestUpdate();+ update.setId(1L);+ update.setRequest(mergeRequest);+ mergeRequest.getUpdates().add(update);++ update = new MergeRequestUpdate();+ update.setId(2L);+ update.setRequest(mergeRequest);+ mergeRequest.getUpdates().add(update);++ update = new MergeRequestUpdate();+ update.setId(3L);+ update.setRequest(mergeRequest);+ mergeRequest.getUpdates().add(update);++ Assert.assertEquals(mergeRequest.getEffectiveUpdates().size(), 2);+ Assert.assertEquals(mergeRequest.getEffectiveUpdates().get(0).getId().longValue(), 3L);+ }++}diff --git a/parent.general/pom.xml b/parent.general/pom.xmlindex 55b75a0985..dd55afabb1 100644--- a/parent.general/pom.xml+++ b/parent.general/pom.xml@@ -1,390 +1,404 @@<?xml version="1.0" encoding="UTF-8"?>-<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>com.pmease</groupId>- <artifactId>parent.general</artifactId>- <version>1.0.28</version>- <packaging>pom</packaging>- <prerequisites>- <maven>3.0</maven>- </prerequisites>- <build>- <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>- <resources>- <resource>- <directory>src/main/resources</directory>- <filtering>true</filtering>- <includes>- <include>archetype-resource/pom.xml</include>- </includes>- </resource>- <resource>- <directory>src/main/resources</directory>- <excludes>- <exclude>archetype-resource/pom.xml</exclude>- </excludes>- </resource>- <resource>- <directory>src/main/java</directory>- <excludes>- <exclude>**/*.java</exclude>- </excludes>- </resource>- </resources>- <testResources>- <testResource>- <directory>src/test/resources</directory>- </testResource>- <testResource>- <directory>src/test/java</directory>- <excludes>- <exclude>**/*.java</exclude>- </excludes>- </testResource>- </testResources>- <pluginManagement>- <plugins>- <plugin>- <groupId>org.eclipse.m2e</groupId>- <artifactId>lifecycle-mapping</artifactId>- <version>1.0.0</version>- <configuration>- <lifecycleMappingMetadata>- <pluginExecutions>- <pluginExecution>- <pluginExecutionFilter>- <groupId>com.pmease</groupId>- <artifactId>plugin.maven</artifactId>- <versionRange>[1.0.0,]</versionRange>- <goals>- <goal>check-project-dependencies</goal>- <goal>generate-artifact-descriptor</goal>- <goal>generate-plugin-resources</goal>- <goal>generate-product-resources</goal>- <goal>create-product-sandbox</goal>- <goal>run-ant</goal>- </goals>- </pluginExecutionFilter>- <action>- <execute>- <runOnIncremental>true</runOnIncremental>- <runOnConfiguration>true</runOnConfiguration>- </execute>- </action>- </pluginExecution>- <pluginExecution>- <pluginExecutionFilter>- <groupId>org.apache.maven.plugins</groupId>- <artifactId>maven-jar-plugin</artifactId>- <versionRange>[1.0.0,]</versionRange>- <goals>- <goal>jar</goal>- </goals>- </pluginExecutionFilter>- <action>- <ignore/>- </action>- </pluginExecution>- </pluginExecutions>- </lifecycleMappingMetadata>- </configuration>- </plugin>- <plugin>- <artifactId>maven-compiler-plugin</artifactId>- <configuration>- <source>1.7</source>- <target>1.7</target>- </configuration>- </plugin>- <plugin>- <artifactId>maven-archetype-plugin</artifactId>- <version>2.2</version>- <executions>- <execution>- <id>install-archetype</id>- <phase>install</phase>- <goals>- <goal>update-local-catalog</goal>- </goals>- </execution>- </executions>- </plugin>- <plugin>- <artifactId>maven-resources-plugin</artifactId>- <version>2.5</version>- <configuration>- <escapeString>\</escapeString>- </configuration>- </plugin>- <plugin>- <artifactId>maven-jar-plugin</artifactId>- <version>2.4</version>- <executions>- <execution>- <id>default-jar</id>- <phase>never</phase>- <configuration>- <finalName>unwanted</finalName>- <classifier>unwanted</classifier>- </configuration>- </execution>- </executions>- </plugin>- <plugin>- <artifactId>maven-antrun-plugin</artifactId>- <version>1.7</version>- <dependencies>- <dependency>- <groupId>ant</groupId>- <artifactId>ant-apache-regexp</artifactId>- <version>1.6.5</version>- </dependency>- <dependency>- <groupId>org.codehaus.groovy</groupId>- <artifactId>groovy-all</artifactId>- <version>1.8.6</version>- </dependency>- <dependency>- <groupId>org.codehaus.gant</groupId>- <artifactId>gant_groovy1.8</artifactId>- <version>1.9.7</version>- </dependency>- </dependencies>- </plugin>- <plugin>- <groupId>com.pmease</groupId>- <artifactId>plugin.maven</artifactId>- <version>1.0.26</version>- <executions>- <execution>- <id>check-project-dependencies</id>- <phase>compile</phase>- <goals>- <goal>check-project-dependencies</goal>- </goals>- </execution>- <execution>- <id>generate-artifact-descriptor</id>- <phase>compile</phase>- <goals>- <goal>generate-artifact-descriptor</goal>- </goals>- </execution>- <execution>- <id>package-artifact</id>- <phase>package</phase>- <goals>- <goal>package-artifact</goal>- </goals>- </execution>- <execution>- <id>generate-plugin-resources</id>- <phase>compile</phase>- <goals>- <goal>generate-plugin-resources</goal>- </goals>- </execution>- <execution>- <id>generate-product-resources</id>- <phase>compile</phase>- <goals>- <goal>generate-product-resources</goal>- </goals>- </execution>- <execution>- <id>create-product-sandbox</id>- <phase>compile</phase>- <goals>- <goal>create-product-sandbox</goal>- </goals>- </execution>- </executions>- </plugin>- <plugin>- <artifactId>maven-source-plugin</artifactId>- <version>2.1.2</version>- <executions>- <execution>- <id>attach-sources</id>- <phase>package</phase>- <goals>- <goal>jar-no-fork</goal>- </goals>- </execution>- </executions>- </plugin>- <plugin>- <artifactId>maven-javadoc-plugin</artifactId>- <version>2.8.1</version>- <executions>- <execution>- <id>attach-javadocs</id>- <phase>package</phase>- <goals>- <goal>jar</goal>- </goals>- </execution>- </executions>- </plugin>- </plugins>- </pluginManagement>- </build>- <dependencyManagement>- <dependencies>- <dependency>- <groupId>org.slf4j</groupId>- <artifactId>slf4j-api</artifactId>- <version>${slf4jVersion}</version>- </dependency>- <dependency>- <groupId>org.slf4j</groupId>- <artifactId>jul-to-slf4j</artifactId>- <version>${slf4jVersion}</version>- </dependency>- <dependency>- <groupId>ch.qos.logback</groupId>- <artifactId>logback-core</artifactId>- <version>${logbackVersion}</version>- </dependency>- <dependency>- <groupId>ch.qos.logback</groupId>- <artifactId>logback-classic</artifactId>- <version>${logbackVersion}</version>- </dependency>- <dependency>- <groupId>org.apache.commons</groupId>- <artifactId>commons-lang3</artifactId>- <version>3.1</version>- </dependency>- <dependency>- <groupId>commons-codec</groupId>- <artifactId>commons-codec</artifactId>- <version>1.7</version>- </dependency>- <dependency>- <groupId>javax.servlet</groupId>- <artifactId>javax.servlet-api</artifactId>- <version>3.1-b09</version>- </dependency>- <dependency>- <groupId>commons-io</groupId>- <artifactId>commons-io</artifactId>- <version>2.4</version>- </dependency>- <dependency>- <groupId>com.google.code.findbugs</groupId>- <artifactId>jsr305</artifactId>- <version>2.0.1</version>- </dependency>- <dependency>- <groupId>com.google.guava</groupId>- <artifactId>guava</artifactId>- <version>14.0.1</version>- </dependency>- <dependency>- <groupId>org.quartz-scheduler</groupId>- <artifactId>quartz</artifactId>- <version>2.1.7</version>- </dependency>- <dependency>- <groupId>dom4j</groupId>- <artifactId>dom4j</artifactId>- <version>1.6.1</version>- </dependency>- <dependency>- <groupId>org.apache.velocity</groupId>- <artifactId>velocity</artifactId>- <version>1.7</version>- </dependency>- <dependency>- <groupId>commons-httpclient</groupId>- <artifactId>commons-httpclient</artifactId>- <version>3.1</version>- </dependency>- <dependency>- <groupId>joda-time</groupId>- <artifactId>joda-time</artifactId>- <version>2.2</version>- </dependency>- <dependency>- <groupId>commons-collections</groupId>- <artifactId>commons-collections</artifactId>- <version>3.2.1</version>- </dependency>- <dependency>- <groupId>org.javassist</groupId>- <artifactId>javassist</artifactId>- <version>3.18.0-GA</version>- </dependency>- <dependency>- <groupId>org.apache.ant</groupId>- <artifactId>ant</artifactId>- <version>1.9.1</version>- </dependency>- </dependencies>- </dependencyManagement>- <dependencies>- <dependency>- <groupId>junit</groupId>- <artifactId>junit</artifactId>- <version>4.11</version>- <scope>test</scope>- </dependency>- <dependency>- <groupId>org.mockito</groupId>- <artifactId>mockito-all</artifactId>- <version>1.9.5</version>- <scope>test</scope>- </dependency>- </dependencies>- <pluginRepositories>- <pluginRepository>- <releases>- <enabled>true</enabled>- <updatePolicy>never</updatePolicy>- <checksumPolicy>fail</checksumPolicy>- </releases>- <snapshots>- <enabled>true</enabled>- <updatePolicy>never</updatePolicy>- <checksumPolicy>fail</checksumPolicy>- </snapshots>- <id>pmeaseRepo</id>- <name>PMEase Repository</name>- <url>http://artifact.pmease.com/</url>- </pluginRepository>- </pluginRepositories>- <repositories>- <repository>- <id>pmeaseRepo</id>- <name>PMEase Repository</name>- <releases>- <enabled>true</enabled>- <updatePolicy>never</updatePolicy>- <checksumPolicy>fail</checksumPolicy>- </releases>- <snapshots>- <enabled>true</enabled>- <updatePolicy>always</updatePolicy>- <checksumPolicy>fail</checksumPolicy>- </snapshots>- <url>http://artifact.pmease.com/</url>- </repository>- </repositories>- <distributionManagement>- <repository>- <id>pmeaseRepo</id>- <url>http://artifact.pmease.com/</url>- </repository>- </distributionManagement>- <properties>- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>- <slf4jVersion>1.7.5</slf4jVersion>- <logbackVersion>1.0.11</logbackVersion>- <dropwizardVersion>0.7.0-SNAPSHOT</dropwizardVersion>- <jerseyVersion>1.17.1</jerseyVersion>- <jacksonVersion>2.2.3</jacksonVersion>- </properties>+<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>com.pmease</groupId>+ <artifactId>parent.general</artifactId>+ <version>1.0.28</version>+ <packaging>pom</packaging>+ <prerequisites>+ <maven>3.0</maven>+ </prerequisites>+ <build>+ <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>+ <resources>+ <resource>+ <directory>src/main/resources</directory>+ <filtering>true</filtering>+ <includes>+ <include>archetype-resource/pom.xml</include>+ </includes>+ </resource>+ <resource>+ <directory>src/main/resources</directory>+ <excludes>+ <exclude>archetype-resource/pom.xml</exclude>+ </excludes>+ </resource>+ <resource>+ <directory>src/main/java</directory>+ <excludes>+ <exclude>**/*.java</exclude>+ </excludes>+ </resource>+ </resources>+ <testResources>+ <testResource>+ <directory>src/test/resources</directory>+ </testResource>+ <testResource>+ <directory>src/test/java</directory>+ <excludes>+ <exclude>**/*.java</exclude>+ </excludes>+ </testResource>+ </testResources>+ <pluginManagement>+ <plugins>+ <plugin>+ <groupId>org.eclipse.m2e</groupId>+ <artifactId>lifecycle-mapping</artifactId>+ <version>1.0.0</version>+ <configuration>+ <lifecycleMappingMetadata>+ <pluginExecutions>+ <pluginExecution>+ <pluginExecutionFilter>+ <groupId>com.pmease</groupId>+ <artifactId>plugin.maven</artifactId>+ <versionRange>[1.0.0,]</versionRange>+ <goals>+ <goal>check-project-dependencies</goal>+ <goal>generate-artifact-descriptor</goal>+ <goal>generate-plugin-resources</goal>+ <goal>generate-product-resources</goal>+ <goal>create-product-sandbox</goal>+ <goal>run-ant</goal>+ </goals>+ </pluginExecutionFilter>+ <action>+ <execute>+ <runOnIncremental>true</runOnIncremental>+ <runOnConfiguration>true</runOnConfiguration>+ </execute>+ </action>+ </pluginExecution>+ <pluginExecution>+ <pluginExecutionFilter>+ <groupId>org.apache.maven.plugins</groupId>+ <artifactId>maven-jar-plugin</artifactId>+ <versionRange>[1.0.0,]</versionRange>+ <goals>+ <goal>jar</goal>+ </goals>+ </pluginExecutionFilter>+ <action>+ <ignore />+ </action>+ </pluginExecution>+ </pluginExecutions>+ </lifecycleMappingMetadata>+ </configuration>+ </plugin>+ <plugin>+ <artifactId>maven-compiler-plugin</artifactId>+ <configuration>+ <source>1.7</source>+ <target>1.7</target>+ </configuration>+ </plugin>+ <plugin>+ <artifactId>maven-archetype-plugin</artifactId>+ <version>2.2</version>+ <executions>+ <execution>+ <id>install-archetype</id>+ <phase>install</phase>+ <goals>+ <goal>update-local-catalog</goal>+ </goals>+ </execution>+ </executions>+ </plugin>+ <plugin>+ <artifactId>maven-resources-plugin</artifactId>+ <version>2.5</version>+ <configuration>+ <escapeString>\</escapeString>+ </configuration>+ </plugin>+ <plugin>+ <artifactId>maven-jar-plugin</artifactId>+ <version>2.4</version>+ <executions>+ <execution>+ <id>default-jar</id>+ <phase>never</phase>+ <configuration>+ <finalName>unwanted</finalName>+ <classifier>unwanted</classifier>+ </configuration>+ </execution>+ </executions>+ </plugin>+ <plugin>+ <artifactId>maven-antrun-plugin</artifactId>+ <version>1.7</version>+ <dependencies>+ <dependency>+ <groupId>ant</groupId>+ <artifactId>ant-apache-regexp</artifactId>+ <version>1.6.5</version>+ </dependency>+ <dependency>+ <groupId>org.codehaus.groovy</groupId>+ <artifactId>groovy-all</artifactId>+ <version>1.8.6</version>+ </dependency>+ <dependency>+ <groupId>org.codehaus.gant</groupId>+ <artifactId>gant_groovy1.8</artifactId>+ <version>1.9.7</version>+ </dependency>+ </dependencies>+ </plugin>+ <plugin>+ <groupId>com.pmease</groupId>+ <artifactId>plugin.maven</artifactId>+ <version>1.0.26</version>+ <executions>+ <execution>+ <id>check-project-dependencies</id>+ <phase>compile</phase>+ <goals>+ <goal>check-project-dependencies</goal>+ </goals>+ </execution>+ <execution>+ <id>generate-artifact-descriptor</id>+ <phase>compile</phase>+ <goals>+ <goal>generate-artifact-descriptor</goal>+ </goals>+ </execution>+ <execution>+ <id>package-artifact</id>+ <phase>package</phase>+ <goals>+ <goal>package-artifact</goal>+ </goals>+ </execution>+ <execution>+ <id>generate-plugin-resources</id>+ <phase>compile</phase>+ <goals>+ <goal>generate-plugin-resources</goal>+ </goals>+ </execution>+ <execution>+ <id>generate-product-resources</id>+ <phase>compile</phase>+ <goals>+ <goal>generate-product-resources</goal>+ </goals>+ </execution>+ <execution>+ <id>create-product-sandbox</id>+ <phase>compile</phase>+ <goals>+ <goal>create-product-sandbox</goal>+ </goals>+ </execution>+ </executions>+ </plugin>+ <plugin>+ <artifactId>maven-source-plugin</artifactId>+ <version>2.1.2</version>+ <executions>+ <execution>+ <id>attach-sources</id>+ <phase>package</phase>+ <goals>+ <goal>jar-no-fork</goal>+ </goals>+ </execution>+ </executions>+ </plugin>+ <plugin>+ <artifactId>maven-javadoc-plugin</artifactId>+ <version>2.8.1</version>+ <executions>+ <execution>+ <id>attach-javadocs</id>+ <phase>package</phase>+ <goals>+ <goal>jar</goal>+ </goals>+ </execution>+ </executions>+ </plugin>+ </plugins>+ </pluginManagement>+ </build>+ <dependencyManagement>+ <dependencies>+ <dependency>+ <groupId>org.slf4j</groupId>+ <artifactId>slf4j-api</artifactId>+ <version>${slf4jVersion}</version>+ </dependency>+ <dependency>+ <groupId>org.slf4j</groupId>+ <artifactId>jul-to-slf4j</artifactId>+ <version>${slf4jVersion}</version>+ </dependency>+ <dependency>+ <groupId>ch.qos.logback</groupId>+ <artifactId>logback-core</artifactId>+ <version>${logbackVersion}</version>+ </dependency>+ <dependency>+ <groupId>ch.qos.logback</groupId>+ <artifactId>logback-classic</artifactId>+ <version>${logbackVersion}</version>+ </dependency>+ <dependency>+ <groupId>org.apache.commons</groupId>+ <artifactId>commons-lang3</artifactId>+ <version>3.1</version>+ </dependency>+ <dependency>+ <groupId>commons-codec</groupId>+ <artifactId>commons-codec</artifactId>+ <version>1.7</version>+ </dependency>+ <dependency>+ <groupId>javax.servlet</groupId>+ <artifactId>javax.servlet-api</artifactId>+ <version>3.1-b09</version>+ </dependency>+ <dependency>+ <groupId>commons-io</groupId>+ <artifactId>commons-io</artifactId>+ <version>2.4</version>+ </dependency>+ <dependency>+ <groupId>com.google.code.findbugs</groupId>+ <artifactId>jsr305</artifactId>+ <version>2.0.1</version>+ </dependency>+ <dependency>+ <groupId>com.google.guava</groupId>+ <artifactId>guava</artifactId>+ <version>14.0.1</version>+ </dependency>+ <dependency>+ <groupId>org.quartz-scheduler</groupId>+ <artifactId>quartz</artifactId>+ <version>2.1.7</version>+ </dependency>+ <dependency>+ <groupId>dom4j</groupId>+ <artifactId>dom4j</artifactId>+ <version>1.6.1</version>+ </dependency>+ <dependency>+ <groupId>org.apache.velocity</groupId>+ <artifactId>velocity</artifactId>+ <version>1.7</version>+ </dependency>+ <dependency>+ <groupId>commons-httpclient</groupId>+ <artifactId>commons-httpclient</artifactId>+ <version>3.1</version>+ </dependency>+ <dependency>+ <groupId>joda-time</groupId>+ <artifactId>joda-time</artifactId>+ <version>2.2</version>+ </dependency>+ <dependency>+ <groupId>commons-collections</groupId>+ <artifactId>commons-collections</artifactId>+ <version>3.2.1</version>+ </dependency>+ <dependency>+ <groupId>org.javassist</groupId>+ <artifactId>javassist</artifactId>+ <version>3.18.0-GA</version>+ </dependency>+ <dependency>+ <groupId>org.apache.ant</groupId>+ <artifactId>ant</artifactId>+ <version>1.9.1</version>+ </dependency>+ </dependencies>+ </dependencyManagement>+ <dependencies>+ <dependency>+ <groupId>junit</groupId>+ <artifactId>junit</artifactId>+ <version>4.11</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>org.mockito</groupId>+ <artifactId>mockito-all</artifactId>+ <version>1.9.5</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>org.powermock</groupId>+ <artifactId>powermock-module-junit4</artifactId>+ <version>${powermockVersion}</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>org.powermock</groupId>+ <artifactId>powermock-api-mockito</artifactId>+ <version>${powermockVersion}</version>+ <scope>test</scope>+ </dependency>+ </dependencies>+ <pluginRepositories>+ <pluginRepository>+ <releases>+ <enabled>true</enabled>+ <updatePolicy>never</updatePolicy>+ <checksumPolicy>fail</checksumPolicy>+ </releases>+ <snapshots>+ <enabled>true</enabled>+ <updatePolicy>never</updatePolicy>+ <checksumPolicy>fail</checksumPolicy>+ </snapshots>+ <id>pmeaseRepo</id>+ <name>PMEase Repository</name>+ <url>http://artifact.pmease.com/</url>+ </pluginRepository>+ </pluginRepositories>+ <repositories>+ <repository>+ <id>pmeaseRepo</id>+ <name>PMEase Repository</name>+ <releases>+ <enabled>true</enabled>+ <updatePolicy>never</updatePolicy>+ <checksumPolicy>fail</checksumPolicy>+ </releases>+ <snapshots>+ <enabled>true</enabled>+ <updatePolicy>always</updatePolicy>+ <checksumPolicy>fail</checksumPolicy>+ </snapshots>+ <url>http://artifact.pmease.com/</url>+ </repository>+ </repositories>+ <distributionManagement>+ <repository>+ <id>pmeaseRepo</id>+ <url>http://artifact.pmease.com/</url>+ </repository>+ </distributionManagement>+ <properties>+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>+ <slf4jVersion>1.7.5</slf4jVersion>+ <logbackVersion>1.0.11</logbackVersion>+ <dropwizardVersion>0.7.0-SNAPSHOT</dropwizardVersion>+ <jerseyVersion>1.17.1</jerseyVersion>+ <jacksonVersion>2.2.3</jacksonVersion>+ <powermockVersion>1.5.1</powermockVersion>+ </properties></project>