private File generatePomFile()

in src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java [456:477]


    private File generatePomFile() throws MojoExecutionException {
        Model model = generateModel();

        Writer fw = null;
        try {
            File tempFile = File.createTempFile("mvndeploy", ".pom");
            tempFile.deleteOnExit();

            fw = WriterFactory.newXmlWriter(tempFile);

            new MavenXpp3Writer().write(fw, model);

            fw.close();
            fw = null;

            return tempFile;
        } catch (IOException e) {
            throw new MojoExecutionException("Error writing temporary pom file: " + e.getMessage(), e);
        } finally {
            IOUtil.close(fw);
        }
    }