Search in sources :

Example 1 with LibraryScope

use of org.springframework.boot.loader.tools.LibraryScope in project spring-boot by spring-projects.

the class ArtifactsLibraries method doWithLibraries.

@Override
public void doWithLibraries(LibraryCallback callback) throws IOException {
    Set<String> duplicates = getDuplicates(this.artifacts);
    for (Artifact artifact : this.artifacts) {
        LibraryScope scope = SCOPES.get(artifact.getScope());
        if (scope != null && artifact.getFile() != null) {
            String name = getFileName(artifact);
            if (duplicates.contains(name)) {
                this.log.debug("Duplicate found: " + name);
                name = artifact.getGroupId() + "-" + name;
                this.log.debug("Renamed to: " + name);
            }
            callback.library(new Library(name, artifact.getFile(), scope, isUnpackRequired(artifact)));
        }
    }
}
Also used : Library(org.springframework.boot.loader.tools.Library) LibraryScope(org.springframework.boot.loader.tools.LibraryScope) Artifact(org.apache.maven.artifact.Artifact)

Aggregations

Artifact (org.apache.maven.artifact.Artifact)1 Library (org.springframework.boot.loader.tools.Library)1 LibraryScope (org.springframework.boot.loader.tools.LibraryScope)1