public void execute() throws MojoExecutionException {
        if (!xcodeCommandLine.exists()) {
            throw new MojoExecutionException("Invalid path for xcodebuild: " + xcodeCommandLine.getAbsolutePath());
        }

        CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor();
        executor.setLogger(this.getLog());
        List<String> commands = new ArrayList<String>();
        commands.add("clean");

        if (xcodeProject != null) {
            commands.add("-project");
            commands.add(xcodeProject.getAbsolutePath());
        }
        if (xcodeTarget != null) {
            commands.add("-target");
            commands.add(xcodeTarget);
        }
        if (xcodeConfiguration != null) {
            commands.add("-configuration");
            commands.add(xcodeConfiguration);
        }
        if (xcodeWorkspace != null) {
            commands.add("-workspace");
            commands.add(xcodeWorkspace.getAbsolutePath());
        }
        if (xcodeScheme != null) {
            commands.add("-scheme");
            commands.add(xcodeScheme);
        }

        getLog().info(xcodeCommandLine.getAbsolutePath() + " " + commands.toString());

        try {
            executor.executeCommand(xcodeCommandLine.getAbsolutePath(), commands, false);
        } catch (ExecutionException e) {
            getLog().error(executor.getStandardOut());
            getLog().error(executor.getStandardError());
            throw new MojoExecutionException("Error while executing: ", e);
        }

        try {
            getLog().info("Deleting " + buildDirectory);
            FileUtils.deleteDirectory(buildDirectory);
        } catch (IOException e) {
            getLog().error("Failed to delete build directory.");
            throw new MojoExecutionException("Error while deleting build directory: ", e);
        }

    }