public void execute()

in maven-script/maven-script-ant/src/main/java/org/apache/maven/script/ant/AntMojoWrapper.java [83:140]


    public void execute() throws MojoExecutionException {
        if (antProject == null) {
            antProject = scriptInvoker.getProject();
        }

        Map<String, Object> allConfig = new HashMap<>();
        if (pluginContext != null && !pluginContext.isEmpty()) {
            allConfig.putAll(pluginContext);
        }

        @SuppressWarnings("unchecked")
        Map<String, PathTranslator> refs = scriptInvoker.getReferences();
        if (refs != null) {
            allConfig.putAll(refs);

            for (Map.Entry<String, PathTranslator> entry : refs.entrySet()) {
                if (entry.getKey().startsWith(PathTranslator.class.getName())) {
                    pathTranslator = entry.getValue();
                }
            }
        }

        mavenProject = (MavenProject) allConfig.get("project");

        mojoExecution = (MojoExecution) allConfig.get("mojoExecution");

        session = (MavenSession) allConfig.get("session");

        unpackFileBasedResources();

        addClasspathReferences();

        if (logger.isDebugEnabled() && !unconstructedParts.isEmpty()) {
            StringBuilder buffer = new StringBuilder();

            buffer.append("The following standard Maven Ant-mojo support objects could not be created:\n\n");

            for (String part : unconstructedParts) {
                buffer.append("\n-  ").append(part);
            }

            buffer.append(
                    "\n\nMaven project, session, mojo-execution, or path-translation parameter " + "information is ");
            buffer.append("\nmissing from this mojo's plugin descriptor.");
            buffer.append("\n\nPerhaps this Ant-based mojo depends on maven-script-ant < 2.1.0, ");
            buffer.append("or used maven-plugin-tools-ant < 2.2 during release?\n\n");

            logger.debug(buffer.toString());
        }

        try {
            scriptInvoker.invoke();
        } catch (AntComponentExecutionException e) {
            throw new MojoExecutionException("Failed to execute: " + e.getMessage(), e);
        }

        unconstructedParts.clear();
    }