Why doesn't this method use the relocators to relocate the classpath when using the maven-shade-plugin ?
org.springframework.boot.maven.PropertiesMergingResourceTransformer
...
@Override
public void processResource(String resource, InputStream inputStream, List<Relocator> relocators, long time)
throws IOException {
Properties properties = new Properties();
properties.load(inputStream);
properties.forEach((name, value) -> process((String) name, (String) value));
if (time > this.time) {
this.time = time;
}
}
...
Comment From: wilkinsona
We’ve never seen I need for it (and you haven’t described one).
The transformer’s purpose is to merge multiple clashing properties files into a single properties file. Beyond the files being in properties format, it knows nothing about their contents.
Comment From: SkyeBeFreeman
We’ve never seen I need for it (and you haven’t described one).
The transformer’s purpose is to merge multiple clashing properties files into a single properties file. Beyond the files being in properties format, it knows nothing about their contents.
@wilkinsona Hello, I am an SDK developer, and I develop SDK based on spring cloud ( project link ). I have a scenario where I need to package some third-party dependencies into the SDK uber-jar package through Maven shade, and use Maven shade's relocation to modify the class name to prevent conflicts with the same dependencies introduced by developers using the SDK. These third-party dependencies may contain spring.factories files, and the contents in them need to be merged using PropertiesMergingResourceTransformer. Therefore, the related class names in the third-party dependencies also need to go through a relocation and then merged into the final spring.factories file.
Comment From: philwebb
We discussed this today and we don't want to support the additional complexity involved with applying relocation to merged properties. We prefer to keep ourselves aligned with the way that org.apache.maven.plugins.shade.resource.AppendingTransformer
from Maven behaves.
We recommend developing your own transformer if you want to merge and relocate properties.