Merge pull request #34177 from izeye
* gh-34177: Fix name for Implementation-Title in Spring Boot Gradle plugin Closes gh-34177
This commit is contained in:
		
						commit
						cbf6e01df5
					
				| 
						 | 
				
			
			@ -87,7 +87,7 @@ class BootArchiveSupport {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	void configureManifest(Manifest manifest, String mainClass, String classes, String lib, String classPathIndex,
 | 
			
		||||
			String layersIndex, String jdkVersion, String implementationName, Object implementationVersion) {
 | 
			
		||||
			String layersIndex, String jdkVersion, String implementationTitle, Object implementationVersion) {
 | 
			
		||||
		Attributes attributes = manifest.getAttributes();
 | 
			
		||||
		attributes.putIfAbsent("Main-Class", this.loaderMainClass);
 | 
			
		||||
		attributes.putIfAbsent("Start-Class", mainClass);
 | 
			
		||||
| 
						 | 
				
			
			@ -101,7 +101,7 @@ class BootArchiveSupport {
 | 
			
		|||
			attributes.putIfAbsent("Spring-Boot-Layers-Index", layersIndex);
 | 
			
		||||
		}
 | 
			
		||||
		attributes.putIfAbsent("Build-Jdk-Spec", jdkVersion);
 | 
			
		||||
		attributes.putIfAbsent("Implementation-Name", implementationName);
 | 
			
		||||
		attributes.putIfAbsent("Implementation-Title", implementationTitle);
 | 
			
		||||
		if (implementationVersion != null) {
 | 
			
		||||
			String versionString = implementationVersion.toString();
 | 
			
		||||
			if (!UNSPECIFIED_VERSION.equals(versionString)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -132,7 +132,7 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
 | 
			
		|||
					.isEqualTo(this.classesPath);
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Spring-Boot-Lib")).isEqualTo(this.libPath);
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Spring-Boot-Version")).isNotNull();
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Implementation-Name"))
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Implementation-Title"))
 | 
			
		||||
					.isEqualTo(this.project.getName());
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Implementation-Version")).isNull();
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -141,10 +141,10 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
 | 
			
		|||
	@Test
 | 
			
		||||
	void whenImplementationNameIsCustomizedItShouldAppearInArchiveManifest() throws IOException {
 | 
			
		||||
		this.task.getMainClass().set("com.example.Main");
 | 
			
		||||
		this.task.getManifest().getAttributes().put("Implementation-Name", "Customized");
 | 
			
		||||
		this.task.getManifest().getAttributes().put("Implementation-Title", "Customized");
 | 
			
		||||
		executeTask();
 | 
			
		||||
		try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) {
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Implementation-Name"))
 | 
			
		||||
			assertThat(jarFile.getManifest().getMainAttributes().getValue("Implementation-Title"))
 | 
			
		||||
					.isEqualTo("Customized");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue