public void processResource()

in src/main/java/org/apache/maven/plugins/shade/resource/ManifestResourceTransformer.java [80:116]


    public void processResource(String resource, InputStream is, List<Relocator> relocators, long time)
            throws IOException {
        // We just want to take the first manifest we come across as that's our project's manifest. This is the behavior
        // now which is situational at best. Right now there is no context passed in with the processing so we cannot
        // tell what artifact is being processed.
        if (!manifestDiscovered) {
            manifest = new Manifest(is);

            if (relocators != null && !relocators.isEmpty()) {
                final Attributes attributes = manifest.getMainAttributes();

                for (final String attribute : defaultAttributes) {
                    final String attributeValue = attributes.getValue(attribute);
                    if (attributeValue != null) {
                        String newValue = relocate(attributeValue, relocators);
                        attributes.putValue(attribute, newValue);
                    }
                }

                if (additionalAttributes != null) {
                    for (final String attribute : additionalAttributes) {
                        final String attributeValue = attributes.getValue(attribute);
                        if (attributeValue != null) {
                            String newValue = relocate(attributeValue, relocators);
                            attributes.putValue(attribute, newValue);
                        }
                    }
                }
            }

            manifestDiscovered = true;

            if (time > this.time) {
                this.time = time;
            }
        }
    }