"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildSrc/src/main/java/org/springframework/boot/build/MavenPublishingConventions.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

MavenPublishingConventions.java  (spring-boot-2.7.3):MavenPublishingConventions.java  (spring-boot-2.7.4)
/* /*
* Copyright 2012-2021 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skipping to change at line 25 skipping to change at line 25
*/ */
package org.springframework.boot.build; package org.springframework.boot.build;
import org.apache.maven.artifact.repository.MavenArtifactRepository; import org.apache.maven.artifact.repository.MavenArtifactRepository;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.attributes.Usage; import org.gradle.api.attributes.Usage;
import org.gradle.api.component.AdhocComponentWithVariants; import org.gradle.api.component.AdhocComponentWithVariants;
import org.gradle.api.component.ConfigurationVariantDetails; import org.gradle.api.component.ConfigurationVariantDetails;
import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.publish.PublishingExtension; import org.gradle.api.publish.PublishingExtension;
import org.gradle.api.publish.VariantVersionMappingStrategy; import org.gradle.api.publish.VariantVersionMappingStrategy;
import org.gradle.api.publish.maven.MavenPom; import org.gradle.api.publish.maven.MavenPom;
import org.gradle.api.publish.maven.MavenPomDeveloperSpec; import org.gradle.api.publish.maven.MavenPomDeveloperSpec;
import org.gradle.api.publish.maven.MavenPomIssueManagement; import org.gradle.api.publish.maven.MavenPomIssueManagement;
import org.gradle.api.publish.maven.MavenPomLicenseSpec; import org.gradle.api.publish.maven.MavenPomLicenseSpec;
import org.gradle.api.publish.maven.MavenPomOrganization; import org.gradle.api.publish.maven.MavenPomOrganization;
import org.gradle.api.publish.maven.MavenPomScm; import org.gradle.api.publish.maven.MavenPomScm;
import org.gradle.api.publish.maven.MavenPublication; import org.gradle.api.publish.maven.MavenPublication;
skipping to change at line 118 skipping to change at line 117
(strategy) -> strategy.usage(Usage.JAVA_RUNTIME, VariantVersionMappingStrategy::fromResolutionResult)); (strategy) -> strategy.usage(Usage.JAVA_RUNTIME, VariantVersionMappingStrategy::fromResolutionResult));
} }
/** /**
* Add a feature that allows maven plugins to declare optional dependenci es that * Add a feature that allows maven plugins to declare optional dependenci es that
* appear in the POM. This is required to make m2e in Eclipse happy. * appear in the POM. This is required to make m2e in Eclipse happy.
* @param project the project to add the feature to * @param project the project to add the feature to
*/ */
private void addMavenOptionalFeature(Project project) { private void addMavenOptionalFeature(Project project) {
JavaPluginExtension extension = project.getExtensions().getByType (JavaPluginExtension.class); JavaPluginExtension extension = project.getExtensions().getByType (JavaPluginExtension.class);
JavaPluginConvention convention = project.getConvention().getPlug in(JavaPluginConvention.class);
extension.registerFeature("mavenOptional", extension.registerFeature("mavenOptional",
(feature) -> feature.usingSourceSet(convention.ge tSourceSets().getByName("main"))); (feature) -> feature.usingSourceSet(extension.get SourceSets().getByName("main")));
AdhocComponentWithVariants javaComponent = (AdhocComponentWithVar iants) project.getComponents() AdhocComponentWithVariants javaComponent = (AdhocComponentWithVar iants) project.getComponents()
.findByName("java"); .findByName("java");
javaComponent.addVariantsFromConfiguration( javaComponent.addVariantsFromConfiguration(
project.getConfigurations().findByName("mavenOpti onalRuntimeElements"), project.getConfigurations().findByName("mavenOpti onalRuntimeElements"),
ConfigurationVariantDetails::mapToOptional); ConfigurationVariantDetails::mapToOptional);
} }
private void suppressMavenOptionalFeatureWarnings(MavenPublication public ation) { private void suppressMavenOptionalFeatureWarnings(MavenPublication public ation) {
publication.suppressPomMetadataWarningsFor("mavenOptionalApiEleme nts"); publication.suppressPomMetadataWarningsFor("mavenOptionalApiEleme nts");
publication.suppressPomMetadataWarningsFor("mavenOptionalRuntimeE lements"); publication.suppressPomMetadataWarningsFor("mavenOptionalRuntimeE lements");
 End of changes. 4 change blocks. 
4 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)