@Override
 protected void setUp() throws Exception {
   super.setUp();
   MavenCustomRepositoryHelper helper =
       new MavenCustomRepositoryHelper(myDir, "plugins", "local1");
   helper.copy("plugins", "local1");
   setRepositoryPath(helper.getTestDataPath("local1"));
 }
  public void testDownloadingNecessaryPlugins() throws Exception {
    MavenCustomRepositoryHelper helper = new MavenCustomRepositoryHelper(myDir, "local1");
    setRepositoryPath(helper.getTestDataPath("local1"));

    File pluginFile =
        new File(
            getRepositoryPath(),
            "org/codehaus/mojo/build-helper-maven-plugin/1.2/build-helper-maven-plugin-1.2.jar");
    assertFalse(pluginFile.exists());

    importProject(
        "<groupId>test</groupId>"
            + "<artifactId>project</artifactId>"
            + "<version>1</version>"
            + "<build>"
            + "  <plugins>"
            + "    <plugin>"
            + "      <groupId>org.codehaus.mojo</groupId>"
            + "      <artifactId>build-helper-maven-plugin</artifactId>"
            + "      <version>1.2</version>"
            + "      <executions>"
            + "        <execution>"
            + "          <id>someId</id>"
            + "          <phase>generate-sources</phase>"
            + "          <goals>"
            + "            <goal>add-source</goal>"
            + "          </goals>"
            + "          <configuration>"
            + "            <sources>"
            + "              <source>src</source>"
            + "            </sources>"
            + "          </configuration>"
            + "        </execution>"
            + "      </executions>"
            + "    </plugin>"
            + "  </plugins>"
            + "</build>");
    resolveDependenciesAndImport();
    resolveFoldersAndImport();

    assertTrue(pluginFile.exists());
  }