private File writeTargetToProjectFile()

in src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java [507:524]


    private File writeTargetToProjectFile(String targetName) throws IOException {
        // The fileName should probably use the plugin executionId instead of the targetName
        File buildFile = new File(mavenProject.getBuild().getDirectory(), "antrun/build-" + targetName + ".xml");
        // noinspection ResultOfMethodCallIgnored
        buildFile.getParentFile().mkdirs();

        AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter();

        String taskPrefix = getTaskPrefix();
        if (taskPrefix != null) {
            // replace namespace as Ant expects it to be
            target.setAttribute("xmlns:" + taskPrefix, TASK_URI);
        }

        xmlWriter.write(target, buildFile, "", targetName);

        return buildFile;
    }