Propagate manifest to exploded jars
Update `LaunchedURLClassLoader` so that packages defined from exploded archive folders have manifest attributes applied to them. Prior to this calling `package.getImplementationTitle()` would only return the a manifiest attribute when running non-exploded. The root cause of this issue is the way that `URLClassLoader` handles the different URL types. For URLs that reference a jar the manifest is available. For URLs that reference a folder it isn't. When running exploded we use a URL that references to the `BOOT-INF/classes` folder directly. To fix the issue we now attempt to detect when `definePackage` is being called directly, and replace `null` entries with actual manifest values. Fixes gh-21705pull/21793/head
parent
400a168ce9
commit
9a235197dc
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed 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
|
||||
*
|
||||
* https://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 explodedsample;
|
||||
|
||||
/**
|
||||
* Example class used to test class loading.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class ExampleClass {
|
||||
|
||||
}
|
Loading…
Reference in New Issue