protected void handleWebResources()

in src/main/java/org/apache/maven/plugins/war/packaging/WarProjectPackagingTask.java [115:137]


    protected void handleWebResources(WarPackagingContext context) throws MojoExecutionException {
        for (Resource resource : webResources) {

            // MWAR-246
            if (resource.getDirectory() == null) {
                throw new MojoExecutionException("The <directory> tag is missing from the <resource> tag.");
            }

            if (!(new File(resource.getDirectory())).isAbsolute()) {
                resource.setDirectory(context.getProject().getBasedir() + File.separator + resource.getDirectory());
            }

            // Make sure that the resource directory is not the same as the webappDirectory
            if (!resource.getDirectory().equals(context.getWebappDirectory().getPath())) {

                try {
                    copyResources(context, resource);
                } catch (IOException e) {
                    throw new MojoExecutionException("Could not copy resource [" + resource.getDirectory() + "]", e);
                }
            }
        }
    }