You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2015/07/23 11:30:33 UTC
[08/13] git commit: [flex-utilities] [refs/heads/develop] - - Renamed
the root directory - Renamed the artifact of the maven-extension to
flex-sdk-converter-maven-extension
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/deployers/aether/src/main/java/org/apache/flex/utilities/converter/deployer/aether/AetherDeployer.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/deployers/aether/src/main/java/org/apache/flex/utilities/converter/deployer/aether/AetherDeployer.java b/flex-maven-tools/flex-sdk-converter/deployers/aether/src/main/java/org/apache/flex/utilities/converter/deployer/aether/AetherDeployer.java
new file mode 100644
index 0000000..89b991b
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/deployers/aether/src/main/java/org/apache/flex/utilities/converter/deployer/aether/AetherDeployer.java
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.deployer.aether;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader;
+import org.apache.maven.repository.internal.DefaultVersionRangeResolver;
+import org.apache.maven.repository.internal.DefaultVersionResolver;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.impl.*;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.internal.impl.DefaultDependencyCollector;
+import org.eclipse.aether.internal.impl.DefaultTransporterProvider;
+import org.eclipse.aether.repository.Authentication;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.transport.TransporterFactory;
+import org.eclipse.aether.spi.connector.transport.TransporterProvider;
+import org.eclipse.aether.transport.file.FileTransporterFactory;
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
+import org.eclipse.aether.transport.wagon.WagonTransporterFactory;
+import org.eclipse.aether.util.repository.AuthenticationBuilder;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Updated Version of the SDKDeployer which no longer relies on an installed Maven
+ * system and which performs the deployment inside the VM without having to spawn new
+ * VMs for each artifact in order to deploy the files using a Maven commandline
+ * execution.
+ *
+ * Created with IntelliJ IDEA.
+ * Date: 03.11.13
+ */
+public class AetherDeployer {
+
+ private File directory;
+ private String url;
+ private String username;
+ private String password;
+
+ public AetherDeployer(File directory, String url, String username, String password) {
+ this.directory = directory;
+ this.url = url;
+ this.username = username;
+ this.password = password;
+ }
+
+ public AetherDeployer(String[] parameters) {
+ this.directory = new File(parameters[0]);
+ this.url = parameters[1];
+ if (parameters.length > 2) {
+ this.username = parameters[2];
+ this.password = parameters[3];
+ }
+ }
+
+ public static void main(String[] args) {
+ if ((args.length != 2) && (args.length != 4)) {
+ printUsage();
+ System.exit(0);
+ }
+
+ final AetherDeployer deployer = new AetherDeployer(args);
+ deployer.deploy();
+ }
+
+ private static void printUsage() {
+ System.out.println("\nUsage: java -cp flex-sdk-converter-1.0.jar SDKInVMDeployer \"directory\" \"url\" [\"username\", \"password\"]\n");
+ System.out.println("The SDKDeployer needs at least 2 ordered parameters separated by spaces:");
+ System.out.println("\t1- directory: The path to the directory containing the artifacts that should be deployed.");
+ System.out.println("\t2- url: URL where the artifacts will be deployed.");
+ System.out.println("If the targeted repository requires authentication two more parameters have to be provided:");
+ System.out.println("\t3- username: The username used to authenticate on the target repository.");
+ System.out.println("\t4- password: The password used to authenticate on the target repository.");
+ }
+
+ public void deploy() {
+ try {
+ final DefaultServiceLocator locator = new DefaultServiceLocator();
+ locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
+ locator.addService(VersionResolver.class, DefaultVersionResolver.class);
+ locator.addService(VersionRangeResolver.class, DefaultVersionRangeResolver.class);
+ locator.addService(ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class);
+ locator.addService(DependencyCollector.class, DefaultDependencyCollector.class);
+ locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
+ locator.addService(TransporterProvider.class, DefaultTransporterProvider.class);
+ locator.addService(TransporterFactory.class, FileTransporterFactory.class);
+ locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
+ locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
+
+ final RepositorySystem repositorySystem = locator.getService(RepositorySystem.class);
+
+ if (repositorySystem == null) {
+ System.out.println("Couldn't initialize local maven repository system.");
+ System.exit(0);
+ } else {
+ // Setup the repository system session based upon the current maven settings.xml.
+ final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
+ final LocalRepository localRepo = new LocalRepository(directory);
+ RemoteRepository.Builder repoBuilder = new RemoteRepository.Builder("repo", "default", url);
+ if ((username != null) && (password != null)) {
+ final Authentication authentication = new AuthenticationBuilder().addUsername(
+ username).addPassword(password).build();
+ repoBuilder.setAuthentication(authentication);
+ }
+ final RemoteRepository remoteRepository = repoBuilder.build();
+
+ session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
+
+ // Process all content of the mavenizer target directory.
+ final File rootDir = directory;
+ processDir(rootDir, repositorySystem, session, remoteRepository);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void processDir(File curDir, RepositorySystem repositorySystem, RepositorySystemSession session,
+ RemoteRepository remoteRepository)
+ throws IOException, XmlPullParserException, InstallationException, DeploymentException {
+ // If the current directory contained any poms,
+ // process them as artifacts.
+ final File[] poms = curDir.listFiles(new PomFilter());
+ if (poms != null) {
+ for (File pom : poms) {
+ processArtifact(pom, repositorySystem, session, remoteRepository);
+ }
+ }
+
+ // If the current directory contained any directories,
+ // continue processing their content.
+ final File[] dirs = curDir.listFiles(new DirFilter());
+ if (dirs != null) {
+ for (File dir : dirs) {
+ processDir(dir, repositorySystem, session, remoteRepository);
+ }
+ }
+ }
+
+ private void processArtifact(File pomFile, RepositorySystem repositorySystem, RepositorySystemSession session,
+ RemoteRepository remoteRepository)
+ throws IOException, XmlPullParserException, InstallationException, DeploymentException {
+ final Reader reader = new FileReader(pomFile);
+ try {
+ final File artifactDirectory = pomFile.getParentFile();
+ final MavenXpp3Reader xpp3Reader = new MavenXpp3Reader();
+ final Model model = xpp3Reader.read(reader);
+
+ // Make the deployer deploy the pom itself.
+ final DeployRequest artifactInstallRequest = new DeployRequest();
+ artifactInstallRequest.setRepository(remoteRepository);
+ Artifact pomArtifact = new DefaultArtifact(
+ model.getGroupId(), model.getArtifactId(), "pom", model.getVersion());
+ pomArtifact = pomArtifact.setFile(pomFile);
+ artifactInstallRequest.addArtifact(pomArtifact);
+
+ // Add any additional files to this installation.
+ final String artifactBaseName = model.getArtifactId() + "-" + model.getVersion();
+ final File artifactFiles[] = artifactDirectory.listFiles(new ArtifactFilter());
+ for (final File artifactFile : artifactFiles) {
+ final String fileName = artifactFile.getName();
+
+ // Handle the case that some file might not start with the base-name.
+ if(!fileName.startsWith(artifactBaseName)) {
+ continue;
+ }
+
+ final String classifier;
+ // This file has a classifier.
+ if (fileName.charAt(artifactBaseName.length()) == '-') {
+ classifier = fileName.substring(artifactBaseName.length() + 1,
+ fileName.indexOf(".", artifactBaseName.length()));
+ }
+ // This file doesn't have a classifier.
+ else {
+ classifier = "";
+ }
+ final String extension = fileName.substring(
+ artifactBaseName.length() + 1 + ((classifier.length() > 0) ? classifier.length() + 1 : 0));
+ Artifact fileArtifact = new DefaultArtifact(model.getGroupId(), model.getArtifactId(),
+ classifier, extension, model.getVersion());
+ fileArtifact = fileArtifact.setFile(artifactFile);
+ artifactInstallRequest.addArtifact(fileArtifact);
+ }
+
+ // Actually install the artifact.
+ System.out.println("Installing Artifact: " + pomArtifact.getGroupId() + ":" +
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion());
+ for (final Artifact artifact : artifactInstallRequest.getArtifacts()) {
+ System.out.println(" - File with extension " + artifact.getExtension() +
+ ((artifact.getClassifier().length() > 0) ? " and classifier " + artifact.getClassifier() : ""));
+ }
+
+ repositorySystem.deploy(session, artifactInstallRequest);
+ } finally {
+ reader.close();
+ }
+ }
+
+ private class PomFilter implements java.io.FileFilter {
+ public boolean accept(File pathname) {
+ return pathname.getName().endsWith(".pom");
+ }
+ }
+
+ private class DirFilter implements java.io.FileFilter {
+ public boolean accept(File pathname) {
+ return pathname.isDirectory();
+ }
+ }
+
+ private class ArtifactFilter implements java.io.FileFilter {
+ public boolean accept(File pathname) {
+ return !pathname.getName().endsWith(".pom") && !pathname.isDirectory();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/deployers/maven/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/deployers/maven/pom.xml b/flex-maven-tools/flex-sdk-converter/deployers/maven/pom.xml
new file mode 100644
index 0000000..c1fc93c
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/deployers/maven/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>deployers</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-deployer</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addClasspath>true</addClasspath>
+ <mainClass>org.apache.flex.utilities.converter.deployer.maven.MavenDeployer</mainClass>
+ </manifest>
+ <manifestEntries>
+ <Implementation-Build>${project.version}</Implementation-Build>
+ </manifestEntries>
+ </archive>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <finalName>maven-deployer-${project.version}-full</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/deployers/maven/src/main/java/org/apache/flex/utilities/converter/deployer/maven/MavenDeployer.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/deployers/maven/src/main/java/org/apache/flex/utilities/converter/deployer/maven/MavenDeployer.java b/flex-maven-tools/flex-sdk-converter/deployers/maven/src/main/java/org/apache/flex/utilities/converter/deployer/maven/MavenDeployer.java
new file mode 100644
index 0000000..6b2da53
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/deployers/maven/src/main/java/org/apache/flex/utilities/converter/deployer/maven/MavenDeployer.java
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.deployer.maven;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * Date: 11.08.12
+ * Time: 18:17
+ */
+public class MavenDeployer {
+
+ private String directory;
+ private String repositoryId;
+ private String url;
+ private String mvn;
+
+ /**
+ * @param parameters
+ */
+ public MavenDeployer(String[] parameters) {
+ super();
+ this.directory = parameters[0];
+ this.repositoryId = parameters[1];
+ this.url = parameters[2];
+ this.mvn = parameters[3];
+ }
+
+ public static void main(String[] args) {
+ if (args.length != 4) {
+ printUsage();
+ System.exit(0);
+ }
+
+ MavenDeployer deployer = new MavenDeployer(args);
+ deployer.start();
+ }
+
+ private static void printUsage() {
+ System.out.println("\nUsage: java -cp flex-sdk-converter-1.0.jar org.apache.flex.utilities.converter.deployer.maven.SDKDeployer \"directory\" \"repositoryId\" \"url\" \"mvn\"\n");
+ System.out.println("The org.apache.flex.utilities.converter.deployer.maven.SDKDeployer needs 4 ordered parameters separated by spaces:");
+ System.out.println("\t1- directory: The path to the directory to deploy.");
+ System.out.println("\t2- repositoryId: Server Id to map on the <id> under <server> section of settings.xml.");
+ System.out.println("\t3- url: URL where the artifacts will be deployed.");
+ System.out.println("\t4- mvn: The path to the mvn.bat / mvn.sh.");
+ }
+
+ private void start() {
+ try {
+ File dir = new File(directory);
+
+ doDir(dir);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void doDir(File dir) throws IOException, InterruptedException {
+ File[] listFiles = dir.listFiles(new PomFilter());
+ if (listFiles != null) {
+ for (File pom : listFiles) {
+ doPom(pom);
+ }
+ }
+
+ File[] listDirs = dir.listFiles(new DirFilter());
+ if (listDirs != null) {
+ for (File subdir : listDirs) {
+ doDir(subdir);
+ }
+ }
+ }
+
+ private void doPom(File pom) throws IOException, InterruptedException {
+ File base = pom.getParentFile();
+ final String fileName = pom.getName();
+ String artifactName = fileName.substring(0, fileName.lastIndexOf("-"));
+
+ if (artifactName != null) {
+ File artifacts[] = new File(pom.getParent()).listFiles(new ArtifactFilter());
+ List<String> processCmdBase = new ArrayList<String>(10);
+ processCmdBase.add(mvn);
+ processCmdBase.add("deploy:deploy-file");
+ processCmdBase.add("-DrepositoryId=" + repositoryId);
+ processCmdBase.add("-Durl=" + url);
+
+ ProcessBuilder processBuilder = null;
+
+
+ String packaging;
+ String classifier = null;
+
+ List<String> processCmd = null;
+ if (artifacts != null && artifacts.length > 0) {
+ for (File artifact : artifacts) {
+ processCmd = new ArrayList<String>(10);
+ processCmd.addAll(processCmdBase);
+ classifier = packaging = null;
+ artifactName = artifact.getName();
+
+ packaging = (artifactName.endsWith("rb.swc")) ? "rb.swc" : artifactName.substring(artifactName.lastIndexOf(".") + 1);
+
+ try {
+ classifier = artifactName
+ .substring(artifactName.indexOf(base.getName()) + base.getName().length() + 1, artifactName.length() - packaging.length() - 1);
+ } catch (StringIndexOutOfBoundsException ex) {/*has no classifier*/}
+
+ processCmd.add("-Dfile=" + artifact.getAbsolutePath());
+ processCmd.add("-DpomFile=" + pom.getAbsolutePath());
+ if (classifier != null && classifier.length() > 0) {
+ processCmd.add("-Dclassifier=" + classifier);
+ }
+ processCmd.add("-Dpackaging=" + packaging);
+ processBuilder = new ProcessBuilder(processCmd);
+ exec(processBuilder.start());
+ }
+ } else {
+ processCmd = new ArrayList<String>(10);
+ processCmd.addAll(processCmdBase);
+ processCmd.add("-Dfile=" + pom.getAbsolutePath());
+ processCmd.add("-DpomFile=" + pom.getAbsolutePath());
+ processBuilder = new ProcessBuilder(processCmd);
+ exec(processBuilder.start());
+ }
+
+ }
+ }
+
+ private void exec(Process p) throws InterruptedException, IOException {
+ String line;
+ BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+ while ((line = bri.readLine()) != null) {
+ System.out.println(line);
+ }
+ while ((line = bre.readLine()) != null) {
+ System.out.println(line);
+ }
+ p.waitFor();
+ bri.close();
+ bre.close();
+ System.out.println("Done.");
+ }
+
+ private class PomFilter implements java.io.FileFilter {
+
+ @Override
+ public boolean accept(File pathname) {
+ return pathname.getName().endsWith(".pom");
+ }
+ }
+
+ private class DirFilter implements java.io.FileFilter {
+
+ @Override
+ public boolean accept(File pathname) {
+ return pathname.isDirectory();
+ }
+ }
+
+ private class ArtifactFilter implements java.io.FileFilter {
+
+ @Override
+ public boolean accept(File pathname) {
+ return !pathname.getName().endsWith(".pom");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/deployers/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/deployers/pom.xml b/flex-maven-tools/flex-sdk-converter/deployers/pom.xml
new file mode 100644
index 0000000..692b45d
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/deployers/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>apache-flex-sdk-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>deployers</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>maven</module>
+ <module>aether</module>
+ </modules>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/maven-extension/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/maven-extension/pom.xml b/flex-maven-tools/flex-sdk-converter/maven-extension/pom.xml
new file mode 100644
index 0000000..b96654b
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/maven-extension/pom.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>apache-flex-sdk-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>flex-sdk-converter-maven-extension</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>sisu-maven-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <id>generate-index</id>
+ <goals>
+ <goal>main-index</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <finalName>flex-sdk-converter-maven-extension-nodeps-${project.version}</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>download-retriever</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>flex-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>flash-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>air-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>fontkit-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>wrapper-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java b/flex-maven-tools/flex-sdk-converter/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
new file mode 100644
index 0000000..4ee9915
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/maven-extension/src/main/java/org/apache/flex/utilities/converter/mavenextension/FlexEventSpy.java
@@ -0,0 +1,294 @@
+package org.apache.flex.utilities.converter.mavenextension;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.flex.utilities.converter.air.AirConverter;
+import org.apache.flex.utilities.converter.flash.FlashConverter;
+import org.apache.flex.utilities.converter.flex.FlexConverter;
+import org.apache.flex.utilities.converter.fontkit.FontkitConverter;
+import org.apache.flex.utilities.converter.retrievers.download.DownloadRetriever;
+import org.apache.flex.utilities.converter.retrievers.types.PlatformType;
+import org.apache.flex.utilities.converter.retrievers.model.ProxySettings;
+import org.apache.flex.utilities.converter.retrievers.types.SdkType;
+import org.apache.flex.utilities.converter.wrapper.WrapperConverter;
+import org.apache.maven.MavenExecutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.eventspy.AbstractEventSpy;
+import org.apache.maven.execution.ExecutionEvent;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.repository.RepositorySystem;
+import org.codehaus.plexus.logging.Logger;
+import org.eclipse.aether.RepositoryEvent;
+import org.eclipse.aether.artifact.Artifact;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+import java.io.File;
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+
+/**
+ * Maven EventSpy that listens for resolution requests and in case of Flex related
+ * artifacts, it pre-checks their availability. If they are not available, it uses
+ * the apache flex sdk converter to automatically download and convert the missing
+ * artifacts before continuing the build normally.
+ *
+ * Created by christoferdutz on 17.04.15.
+ */
+@Named
+@Singleton
+public class FlexEventSpy extends AbstractEventSpy {
+
+ @Inject
+ protected RepositorySystem repositorySystem;
+
+ @Inject
+ protected Logger logger;
+
+ protected MavenSession mavenSession;
+
+ protected boolean internalLookup = false;
+ protected boolean flexSplashScreenShown = false;
+
+ public FlexEventSpy() {
+ }
+
+ @Override
+ public void init(Context context) throws Exception {
+ }
+
+ @Override
+ public void onEvent(Object o) throws Exception {
+ if(o instanceof ExecutionEvent) {
+ mavenSession = ((ExecutionEvent) o).getSession();
+ } else if(o instanceof RepositoryEvent) {
+ RepositoryEvent repositoryEvent = (RepositoryEvent) o;
+ if(repositoryEvent.getType() == RepositoryEvent.EventType.ARTIFACT_RESOLVING) {
+ if(!internalLookup) {
+ try {
+ internalLookup = true;
+ Artifact artifact = repositoryEvent.getArtifact();
+
+ if (artifact.getGroupId().startsWith("org.apache.flex") &&
+ !"rb.swc".equals(artifact.getExtension())) {
+ // Output a cool spash-screen ... sorry for that ... couldn't resist :-)
+ if(!flexSplashScreenShown) {
+ showFlexSplashScreen();
+ }
+
+ if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ artifact.getExtension(), artifact.getClassifier())) {
+ logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
+ artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
+ artifact.getExtension());
+ initFlex(artifact.getVersion());
+ }
+ } else if (artifact.getGroupId().startsWith("com.adobe.flash")) {
+ if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ artifact.getExtension(), artifact.getClassifier())) {
+ logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
+ artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
+ artifact.getExtension());
+ initFlash(artifact.getVersion());
+ }
+ } else if (artifact.getGroupId().startsWith("com.adobe.air")) {
+ if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ artifact.getExtension(), artifact.getClassifier())) {
+ logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
+ artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
+ artifact.getExtension());
+ initAir(artifact.getVersion());
+ }
+ } else if (artifact.getGroupId().equals("com.adobe") && artifact.getArtifactId().equals("fontkit")) {
+ if(!canResolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ artifact.getExtension(), artifact.getClassifier())) {
+ logger.info("Couldn't find artifact: " + artifact.getGroupId() + ":" +
+ artifact.getBaseVersion() + ":" + artifact.getArtifactId() + ":" +
+ artifact.getExtension());
+ initFontkit();
+ }
+ }
+ } finally {
+ internalLookup = false;
+ }
+ }
+ }
+ }
+ }
+
+ protected boolean canResolve(String groupId, String artifactId, String version,
+ String type, String classifier) {
+ try {
+ ArtifactResolutionRequest req = new ArtifactResolutionRequest();
+ req.setLocalRepository(mavenSession.getLocalRepository());
+ req.setRemoteRepositories(mavenSession.getRequest().getRemoteRepositories());
+ if((classifier == null) || (classifier.length() == 0)) {
+ req.setArtifact(repositorySystem.createArtifact(groupId, artifactId, version, type));
+ } else {
+ req.setArtifact(repositorySystem.createArtifactWithClassifier(groupId, artifactId, version, type, classifier));
+ }
+ ArtifactResolutionResult res = repositorySystem.resolve(req);
+ return res.isSuccess();
+ } catch (Throwable e) {
+ return false;
+ }
+ }
+
+ protected void initFlex(String version) throws MavenExecutionException {
+ logger.info("===========================================================");
+ logger.info(" - Installing Apache Flex SDK " + version);
+ try {
+ File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
+ DownloadRetriever downloadRetriever = new DownloadRetriever();
+ File sdkRoot = downloadRetriever.retrieve(SdkType.FLEX, version);
+
+ // In order to create a fully functional wrapper we need to download
+ // SWFObject and merge that with the fdk first.
+ File swfObjectRoot = downloadRetriever.retrieve(SdkType.SWFOBJECT);
+ FileUtils.copyDirectory(swfObjectRoot, sdkRoot);
+
+ // In order to compile some of the themes, we need to download a
+ // playerglobal version.
+ logger.info("In order to convert some of the skins in the Apache Flex SDK, " +
+ "a Flash SDK has to be downloaded.");
+ File flashSdkRoot = downloadRetriever.retrieve(SdkType.FLASH, "10.2");
+ FileUtils.copyDirectory(flashSdkRoot, sdkRoot);
+
+ // Convert the FDK itself.
+ FlexConverter converter = new FlexConverter(sdkRoot, localRepoBaseDir);
+ converter.convert();
+
+ // Convert the wrapper.
+ WrapperConverter wrapperConverter = new WrapperConverter(sdkRoot, localRepoBaseDir);
+ wrapperConverter.convert();
+ } catch (Throwable ce) {
+ throw new MavenExecutionException(
+ "Caught exception while downloading and converting artifact.", ce);
+ }
+ logger.info(" - Finished installing Apache Flex SDK " + version);
+ }
+
+ protected void initFlash(String version) throws MavenExecutionException {
+ logger.info("===========================================================");
+ logger.info(" - Installing Adobe Flash SDK " + version);
+ try {
+ File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
+ DownloadRetriever downloadRetriever = new DownloadRetriever();
+ File sdkRoot = downloadRetriever.retrieve(SdkType.FLASH, version);
+ FlashConverter converter = new FlashConverter(sdkRoot, localRepoBaseDir);
+ converter.convert();
+ } catch (Throwable ce) {
+ throw new MavenExecutionException(
+ "Caught exception while downloading and converting artifact.", ce);
+ }
+ logger.info(" - Finished installing Adobe Flash SDK " + version);
+ }
+
+ protected void initAir(String version) throws MavenExecutionException {
+ logger.info("===========================================================");
+ logger.info(" - Installing Adobe AIR SDK " + version);
+ try {
+ File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
+ DownloadRetriever downloadRetriever = new DownloadRetriever();
+
+ final ProxySettings proxySettings;
+ if(mavenSession.getSettings().getActiveProxy() != null) {
+ proxySettings = getProxySettings();
+ if(!StringUtils.isEmpty(proxySettings.getUsername()) &&
+ !StringUtils.isEmpty(proxySettings.getPassword())) {
+ Authenticator authenticator = new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(proxySettings.getUsername(),
+ proxySettings.getPassword().toCharArray());
+ }
+ };
+ Authenticator.setDefault(authenticator);
+ }
+ } else {
+ proxySettings = null;
+ }
+
+ PlatformType platformType;
+ if(System.getProperty("platform-type") == null) {
+ platformType = PlatformType.getCurrent();
+ } else {
+ platformType = PlatformType.valueOf(System.getProperty("platform-type"));
+ }
+ File sdkRoot = downloadRetriever.retrieve(SdkType.AIR, version, platformType, proxySettings);
+ AirConverter converter = new AirConverter(sdkRoot, localRepoBaseDir);
+ converter.convert();
+ } catch (Throwable ce) {
+ throw new MavenExecutionException(
+ "Caught exception while downloading and converting artifact.", ce);
+ }
+ logger.info(" - Finished installing Adobe AIR SDK " + version);
+ }
+
+ protected void initFontkit() throws MavenExecutionException {
+ logger.info("===========================================================");
+ logger.info(" - Installing Adobe Fontkit libraries");
+ try {
+ File localRepoBaseDir = new File(mavenSession.getLocalRepository().getBasedir());
+ DownloadRetriever downloadRetriever = new DownloadRetriever();
+ File sdkRoot = downloadRetriever.retrieve(SdkType.FONTKIT);
+ FontkitConverter converter = new FontkitConverter(sdkRoot, localRepoBaseDir);
+ converter.convert();
+ } catch (Throwable ce) {
+ throw new MavenExecutionException(
+ "Caught exception while downloading and converting artifact.", ce);
+ }
+ logger.info(" - Finished installing Adobe Fontkit libraries");
+ }
+
+
+ protected void showFlexSplashScreen() {
+ logger.info(" \n" +
+ " `,;':, :';;; \n" +
+ " `:;''';' `++'';;, \n" +
+ " :;'''++;' .+'+''';;;\n" +
+ " : ;'''++++'' ,';+++''';'\n" +
+ " ,. `, ,. ..: , `, `'''+++##;'', ;;'+#+++''''\n" +
+ " ; ; ; ;; ;`: :,: ; ; ;'+++; #;;;;;:::;;;;+ +++'':\n" +
+ " ; ; : ;; ;., : : ;. ;;++# ';;;;;;;;;;+ .+++; \n" +
+ " `;: :; `;: :;: , :;` +;+# ,;;;:::::;: ;#+', \n" +
+ " ;++++:'++ : ;+,; ++;# +;::::::; ,+;;: \n" +
+ " ++++++,'++ `++' +'''` ;::::::, +:;;: \n" +
+ " `+++. '++ ++++++ +++ +++ ''''' ;::::: :;;;; \n" +
+ " +++` '++ ++++++++ +++` `++: :'';;; ;::` ::::: \n" +
+ " +++ '++ +++' :++: +++ +++ ;;;;;' :::::: \n" +
+ " +++ '++ +++ ++' `+++++` ;;;;;;: .:::::` \n" +
+ " +++++++ '++ +++:::+++. +++++ ;;;;;;; ,::::: \n" +
+ " +++++++ '++ +++++++++ :+++' ;;;;;;; ,::::: \n" +
+ " +++''' '++ +++;;;:` +++++ ;;;;;;` ::::::. \n" +
+ " +++ '++ +++ +++ +++ ;;;;;: :::::: \n" +
+ " +++ :++. ++++ ` :++, ,++; ''';;. `..: ::::;` \n" +
+ " +++ ++' +++++++ +++ +++ :'''; ,,,,,: ;;;;; \n" +
+ " ;++` +++ ++++++ +++ +++ .+';+ :,,,,,,: `';;; \n" +
+ " ++' `+''' ::,,,,,::: ';;' \n" +
+ " :++ #;'' +:::,,,:::: .'':; \n" +
+ " ';;'' ::::::::::::' ,';;:.\n" +
+ " ;;;;''`;+;;::` .::;;'.,';;;;:\n" +
+ " `::;;;''':;; `;;;'';;;;;;\n" +
+ " :::;;;'';: ;;';;;;;:;\n" +
+ " ,:::;;;', ',;;;;::`\n" +
+ " .:::;:. ;:;;::: \n" +
+ " ::;, `,;;` \n");
+ flexSplashScreenShown = true;
+ }
+
+ protected ProxySettings getProxySettings() {
+ org.apache.maven.settings.Proxy settingsProxy = mavenSession.getSettings().getActiveProxy();
+ String protocol = settingsProxy.getProtocol();
+ String host = settingsProxy.getHost();
+ int port = settingsProxy.getPort();
+ String nonProxyHost = settingsProxy.getNonProxyHosts();
+ String username = settingsProxy.getUsername();
+ String password = settingsProxy.getPassword();
+
+ return new ProxySettings(protocol, host, port, nonProxyHost, username, password);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/pom.xml b/flex-maven-tools/flex-sdk-converter/pom.xml
new file mode 100644
index 0000000..e5317f6
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>16</version>
+ </parent>
+
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>apache-flex-sdk-converter</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <mavenVersion>3.1.1</mavenVersion>
+ <aetherVersion>0.9.0.M4</aetherVersion>
+ <wagonVersion>2.2</wagonVersion>
+ </properties>
+
+ <mailingLists>
+ <mailingList>
+ <name>Apache Flex User List</name>
+ <subscribe>users-subscribe@flex.apache.org</subscribe>
+ <unsubscribe>users-unsubscribe@flex.apache.org</unsubscribe>
+ <post>users@flex.apache.org</post>
+ <archive>
+ http://mail-archives.apache.org/mod_mbox/flex-users/
+ </archive>
+ </mailingList>
+ </mailingLists>
+
+ <scm>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/flex-utilities.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/flex-utilities.git</developerConnection>
+ <url>https://git-wip-us.apache.org/repos/asf/flex-utilities.git</url>
+ <tag>HEAD</tag>
+ </scm>
+
+ <modules>
+ <module>retrievers</module>
+ <module>converters</module>
+ <module>deployers</module>
+ <module>cli</module>
+ <module>maven-extension</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/pom.xml b/flex-maven-tools/flex-sdk-converter/retrievers/base/pom.xml
new file mode 100644
index 0000000..ace86c6
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/pom.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>retrievers</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>base-retriever</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <powermock.version>1.6.2</powermock.version>
+ <junit.version>4.11</junit.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.3.2</version>
+ </dependency>
+
+ <!--TEST-->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>pl.pragmatists</groupId>
+ <artifactId>JUnitParams</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/BaseRetriever.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/BaseRetriever.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/BaseRetriever.java
new file mode 100644
index 0000000..514ed2e
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/BaseRetriever.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.ArchiveException;
+import org.apache.commons.compress.archivers.ArchiveInputStream;
+import org.apache.commons.compress.archivers.ArchiveStreamFactory;
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
+import org.apache.commons.compress.utils.CountingInputStream;
+import org.apache.flex.utilities.converter.retrievers.exceptions.RetrieverException;
+import org.apache.flex.utilities.converter.retrievers.utils.ProgressBar;
+
+import java.io.*;
+
+/**
+ * Created by cdutz on 18.05.2014.
+ */
+public abstract class BaseRetriever implements Retriever {
+
+ public static final int KILOBYTE = 1024;
+ public static final int MEGABYTE = KILOBYTE * 1024;
+ public static final int BUFFER_MAX = MEGABYTE;
+
+ protected void unpack(File inputArchive, File targetDirectory) throws RetrieverException {
+ if (!targetDirectory.mkdirs()) {
+ throw new RetrieverException(
+ "Unable to create extraction directory " + targetDirectory.getAbsolutePath());
+ }
+
+ ArchiveInputStream archiveInputStream = null;
+ ArchiveEntry entry;
+ try {
+
+ final CountingInputStream inputStream = new CountingInputStream(new FileInputStream(inputArchive));
+
+ final long inputFileSize = inputArchive.length();
+
+ if(inputArchive.getName().endsWith(".tbz2")) {
+ archiveInputStream = new TarArchiveInputStream(
+ new BZip2CompressorInputStream(inputStream));
+ } else {
+ archiveInputStream = new ArchiveStreamFactory().createArchiveInputStream(
+ new BufferedInputStream(inputStream));
+ }
+
+ final ProgressBar progressBar = new ProgressBar(inputFileSize);
+ while ((entry = archiveInputStream.getNextEntry()) != null) {
+ final File outputFile = new File(targetDirectory, entry.getName());
+
+ // Entry is a directory.
+ if (entry.isDirectory()) {
+ if (!outputFile.exists()) {
+ if(!outputFile.mkdirs()) {
+ throw new RetrieverException(
+ "Could not create output directory " + outputFile.getAbsolutePath());
+ }
+ }
+ }
+
+ // Entry is a file.
+ else {
+ final byte[] data = new byte[BUFFER_MAX];
+ final FileOutputStream fos = new FileOutputStream(outputFile);
+ BufferedOutputStream dest = null;
+ try {
+ dest = new BufferedOutputStream(fos, BUFFER_MAX);
+
+ int count;
+ while ((count = archiveInputStream.read(data, 0, BUFFER_MAX)) != -1) {
+ dest.write(data, 0, count);
+ progressBar.updateProgress(inputStream.getBytesRead());
+ }
+ } finally {
+ if(dest != null) {
+ dest.flush();
+ dest.close();
+ }
+ }
+ }
+
+ progressBar.updateProgress(inputStream.getBytesRead());
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (ArchiveException e) {
+ e.printStackTrace();
+ } finally {
+ if(archiveInputStream != null) {
+ try {
+ archiveInputStream.close();
+ } catch(Exception e) {
+ // Ignore...
+ }
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/Retriever.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/Retriever.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/Retriever.java
new file mode 100644
index 0000000..c020378
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/Retriever.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers;
+
+import org.apache.flex.utilities.converter.retrievers.exceptions.RetrieverException;
+import org.apache.flex.utilities.converter.retrievers.types.PlatformType;
+import org.apache.flex.utilities.converter.retrievers.model.ProxySettings;
+import org.apache.flex.utilities.converter.retrievers.types.SdkType;
+
+import java.io.File;
+
+/**
+ * Created by cdutz on 18.05.2014.
+ */
+public interface Retriever {
+
+ File retrieve(SdkType sdkType, String version, PlatformType platformType) throws RetrieverException;
+
+ File retrieve(SdkType sdkType, String version, PlatformType platformType, ProxySettings proxySettings)
+ throws RetrieverException;
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/exceptions/RetrieverException.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/exceptions/RetrieverException.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/exceptions/RetrieverException.java
new file mode 100644
index 0000000..bfb708b
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/exceptions/RetrieverException.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers.exceptions;
+
+/**
+ * Created by cdutz on 07.05.2014.
+ */
+public class RetrieverException extends Exception {
+
+ public RetrieverException(String message) {
+ super(message);
+ }
+
+ public RetrieverException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/model/ProxySettings.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/model/ProxySettings.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/model/ProxySettings.java
new file mode 100644
index 0000000..22661a4
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/model/ProxySettings.java
@@ -0,0 +1,48 @@
+package org.apache.flex.utilities.converter.retrievers.model;
+
+/**
+ * Created by christoferdutz on 01.07.15.
+ */
+public class ProxySettings {
+
+ private String protocol;
+ private String host;
+ private int port;
+ private String nonProxyHost;
+ private String username;
+ private String password;
+
+ public ProxySettings(String protocol, String host, int port, String nonProxyHost, String username, String password) {
+ this.protocol = protocol;
+ this.host = host;
+ this.port = port;
+ this.nonProxyHost = nonProxyHost;
+ this.username = username;
+ this.password = password;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public String getNonProxyHost() {
+ return nonProxyHost;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/PlatformType.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/PlatformType.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/PlatformType.java
new file mode 100644
index 0000000..d7320d4
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/PlatformType.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers.types;
+
+import org.apache.commons.lang3.SystemUtils;
+
+/**
+ * Created by cdutz on 18.05.2014.
+ */
+public enum PlatformType {
+
+ WINDOWS,
+ LINUX,
+ MAC;
+
+ public static PlatformType getCurrent() throws Exception {
+ PlatformType platformType = null;
+
+ if (SystemUtils.IS_OS_WINDOWS)
+ {
+ platformType = PlatformType.WINDOWS;
+ }
+ else if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX)
+ {
+ platformType = PlatformType.MAC;
+ }
+ else if (SystemUtils.IS_OS_UNIX)
+ {
+ platformType = PlatformType.LINUX;
+ }
+ else throw new Exception("Unsupported OS.");
+
+ return platformType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/SdkType.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/SdkType.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/SdkType.java
new file mode 100644
index 0000000..f8b3024
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/types/SdkType.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers.types;
+
+/**
+ * Created by cdutz on 18.05.2014.
+ */
+public enum SdkType {
+
+ FLEX,
+ FLASH,
+ AIR,
+ FONTKIT,
+ SWFOBJECT
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/utils/ProgressBar.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/utils/ProgressBar.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/utils/ProgressBar.java
new file mode 100644
index 0000000..c15d26b
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/main/java/org/apache/flex/utilities/converter/retrievers/utils/ProgressBar.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.flex.utilities.converter.retrievers.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by cdutz on 24.05.2014.
+ */
+public class ProgressBar {
+
+ protected long total;
+
+ public ProgressBar(long total) {
+ this.total = total;
+ drawOutput(0l);
+ }
+
+ public void updateProgress(long current) {
+ drawOutput(current);
+ }
+
+ protected void drawOutput(long current) {
+ final int transferredPercent = (int) Math.round(
+ ((double) current / (double) total) * (double) 100);
+ final int segmentsTransferred = transferredPercent / 2;
+ final int segmentsRest = 50 - segmentsTransferred;
+ System.out.print("\r" + String.format(" %3d", transferredPercent) + "% [" +
+ StringUtils.repeat("=", segmentsTransferred) +
+ ((segmentsRest > 0) ? ">" + StringUtils.repeat(" ", segmentsRest - 1) : "") + "] ");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/base/src/test/java/org/apache/flex/utilities/converter/retrievers/types/PlatformTypeTest.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/base/src/test/java/org/apache/flex/utilities/converter/retrievers/types/PlatformTypeTest.java b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/test/java/org/apache/flex/utilities/converter/retrievers/types/PlatformTypeTest.java
new file mode 100644
index 0000000..eeb6a22
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/base/src/test/java/org/apache/flex/utilities/converter/retrievers/types/PlatformTypeTest.java
@@ -0,0 +1,69 @@
+package org.apache.flex.utilities.converter.retrievers.types;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import org.apache.commons.lang3.SystemUtils;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author: Frederic Thomas
+ * Date: 12/05/2015
+ * Time: 01:34
+ */
+@RunWith(JUnitParamsRunner.class)
+public class PlatformTypeTest {
+
+ private Class<SystemUtils> systemUtilsClass;
+
+ public static Collection<Object[]> platformParameters() {
+ return Arrays.asList(new Object[][]{
+ {"IS_OS_WINDOWS", PlatformType.WINDOWS},
+ {"IS_OS_MAC", PlatformType.MAC},
+ {"IS_OS_MAC_OSX", PlatformType.MAC},
+ {"IS_OS_UNIX", PlatformType.LINUX}
+ });
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ systemUtilsClass = SystemUtils.class;
+
+ setFinalStatic(systemUtilsClass.getField("IS_OS_WINDOWS"), false);
+ setFinalStatic(systemUtilsClass.getField("IS_OS_MAC"), false);
+ setFinalStatic(systemUtilsClass.getField("IS_OS_MAC_OSX"), false);
+ setFinalStatic(systemUtilsClass.getField("IS_OS_UNIX"), false);
+ }
+
+ @Test
+ @Parameters(method = "platformParameters")
+ public void it_detects_the_current_platform_type(String fieldName, PlatformType platformType) throws Exception {
+
+ setFinalStatic(systemUtilsClass.getField(fieldName), true);
+ assertEquals(platformType, PlatformType.getCurrent());
+ }
+
+ @Test(expected = Exception.class)
+ public void it_throws_an_exception_when_it_can_not_detect_the_current_platform_type() throws Exception {
+ PlatformType.getCurrent();
+ }
+
+ private static void setFinalStatic(Field field, Object newValue) throws Exception {
+ field.setAccessible(true);
+
+ // remove final modifier from field
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+
+ field.set(null, newValue);
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/flex-sdk-converter/retrievers/download/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/download/pom.xml b/flex-maven-tools/flex-sdk-converter/retrievers/download/pom.xml
new file mode 100644
index 0000000..ffa2665
--- /dev/null
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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>
+
+ <parent>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>retrievers</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>download-retriever</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.flex.utilities.converter</groupId>
+ <artifactId>base-retriever</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mock-server</groupId>
+ <artifactId>mockserver-netty</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.8.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.2.3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>