All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.plugins.shade.ShadeRequest Maven / Gradle / Ivy

Go to download

Repackages the project classes together with their dependencies into a single uber-jar, optionally renaming classes or removing unused classes.

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.maven.plugins.shade;

import java.io.File;
import java.util.List;
import java.util.Set;

import org.apache.maven.plugins.shade.filter.Filter;
import org.apache.maven.plugins.shade.relocation.Relocator;
import org.apache.maven.plugins.shade.resource.ResourceTransformer;

/**
 * Parameter object used to pass multitude of args to Shader.shade()
 * @since 2.0
 */
public class ShadeRequest {

    private Set jars;

    private File uberJar;

    private List filters;

    private List relocators;

    private List resourceTransformers;

    private boolean shadeSourcesContent;

    public Set getJars() {
        return jars;
    }

    /**
     * Which jars to shade.
     *
     * @param jars The jars.
     */
    public void setJars(Set jars) {
        this.jars = jars;
    }

    public File getUberJar() {
        return uberJar;
    }

    /**
     * Output jar.
     *
     * @param uberJar The ueberJar file.
     */
    public void setUberJar(File uberJar) {
        this.uberJar = uberJar;
    }

    public List getFilters() {
        return filters;
    }

    /**
     * The filters.
     *
     * @param filters The filters
     */
    public void setFilters(List filters) {
        this.filters = filters;
    }

    public List getRelocators() {
        return relocators;
    }

    /**
     * The relocators.
     *
     * @param relocators The relocators.
     */
    public void setRelocators(List relocators) {
        this.relocators = relocators;
    }

    public List getResourceTransformers() {
        return resourceTransformers;
    }

    /**
     * The transformers.
     *
     * @param resourceTransformers List of resourceTransformers.
     */
    public void setResourceTransformers(List resourceTransformers) {
        this.resourceTransformers = resourceTransformers;
    }

    public boolean isShadeSourcesContent() {
        return shadeSourcesContent;
    }

    /**
     * When true, it will attempt to shade the contents of the java source files when creating the sources jar.
     * When false, it will just relocate the java source files to the shaded paths, but will not modify the
     * actual contents of the java source files.
     *
     * @param shadeSourcesContent {@code true} or {@code false}.
     */
    public void setShadeSourcesContent(boolean shadeSourcesContent) {
        this.shadeSourcesContent = shadeSourcesContent;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy