public static void main(String[] args) {

		if (args == null || args.length < 1) {
			throw new IllegalArgumentException("Missing arguments and/or configuration options for Sqoop");
		}

		String jarPath = org.apache.sqoop.util.Jars.getJarPathForClass(JobConf.class);
		String hadoopMapredHome = jarPath.substring(0, jarPath.lastIndexOf(File.separator));

		String command = args[0];
		String[] sqoopArgumentSource = args[1].split(" ");

		List<String> sqoopArguments = new ArrayList<String>();
		boolean provideConnect = parseSqoopCommandArguments(command, sqoopArgumentSource, sqoopArguments);

		logger.info("Sqoop command: " + command);
		logger.info("Using args: " + sqoopArguments);
		logger.info("Mapreduce home: " + hadoopMapredHome);

		Map<String, String> configOptions = new HashMap<String, String>();
		parseConfigOptions(args, configOptions);

		Configuration configuration = createConfiguration(configOptions);

		List<String> finalArguments = new ArrayList<String>();
		createFinalArguments(hadoopMapredHome, command, sqoopArguments, provideConnect, configOptions, finalArguments);

		String xdModuleLibjars = System.getenv("XD_MODULE_LIBJARS");
		if (StringUtils.hasText(xdModuleLibjars)) {
			logger.info("Adding --libjars to Sqoop job submission");
			String[] extraJars = StringUtils.commaDelimitedListToStringArray(xdModuleLibjars);
			List<URL> classPathUrls = new ArrayList<URL>();
			try {
				classPathUrls.addAll(Arrays.asList(((URLClassLoader) SqoopRunner.class.getClassLoader()).getURLs()));
			} catch (Exception ignore) {
			}
			List<Resource> libJars = new ArrayList<>();
			for (String jarName : extraJars) {
				for (URL url : classPathUrls) {
					if (url.getPath().endsWith(jarName)) {
						logger.info("Adding jar: " + url);
						libJars.add(new UrlResource(url));
					}
				}
			}
			ConfigurationUtils.addLibs(configuration, libJars.toArray(new Resource[libJars.size()]));
		}

		if (sqoopArguments.contains("--as-avrodatafile")) {
			logger.info("Adding Avro libraries to Sqoop job submission");
			List<URL> classPathUrls = new ArrayList<URL>();
			try {
				classPathUrls.addAll(Arrays.asList(((URLClassLoader) SqoopRunner.class.getClassLoader()).getURLs()));
			} catch (Exception ignore) {
			}
			List<Resource> libJars = new ArrayList<>();
			for (URL url : classPathUrls) {
				if (url.getPath().contains("avro-mapred-1.7") || url.getPath().contains("avro-1.7")) {
					logger.info("Adding jar: " + url);
					libJars.add(new UrlResource(url));
				}
			}
			ConfigurationUtils.addLibs(configuration, libJars.toArray(new Resource[libJars.size()]));
		}

		final int ret = Sqoop.runTool(finalArguments.toArray(new String[finalArguments.size()]), configuration);

		if (ret != 0) {
			throw new RuntimeException("Sqoop failed - return code "
					+ Integer.toString(ret));
		}
	}
Class for running Sqoop tool.

@since 1.1
@author Thomas Risberg
extensions/spring-xd-extension-sqoop/src/main/java/org/springframework/xd/sqoop/SqoopRunner.java